Project

General

Profile

Bug #11790

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

line 70 in file regparse.h: 

 ~~~c 
 #define *#define SET_NTYPE(node, ntype)     (node)->u.base.type = (ntype) 
 ~~~ (ntype)* 

 needs to be changed to conform with ANSI alias rules 


 Line 70 as it is can lead to errors in compiling in regparse.c 

 ~~~c 
 line *line 1143: node = (Node* )FreeNodeList; )FreeNodeList;* 
 line *line 1144: FreeNodeList = FreeNodeList->next; FreeNodeList->next;* 
 line *line 1581: (node)->u.base.type = (0); 
 ~~~ 

 (0);*  

 where during compiling line 1581 can be moved ahead of line 1144 since under ANSI aliasing rules, the compiler determines that the statement of "(node)->u.base.type = (0);" does not affect the value of FreeNodeList.  

 Proposed change in patch is in file regparse.h: regparse.sh: 

 ~~~diff 
 -#define from:  
 *#define SET_NTYPE(node, ntype)     (node)->u.base.type = (ntype) (ntype)* 
 +#define to: 
 *#define SET_NTYPE(node, ntype)    {int value = ntype; memcpy(&((node)->u.base.type), &value, sizeof((node)->u.base.type));} 
 ~~~ sizeof((node)->u.base.type));}*

Back