This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix non-constant initializer in gengtype-yacc.y


A non-constant struct initializer in gengtype-yacc.y was preventing
bootstrap on mips-sgi-irix6.5 with native cc.  Fixed by the patch below.
Tested on mips-sgi-irix6.5, applied as obvious.

Richard


	* gengtype-yacc.y (option): Avoid use of non-constant struct
	initializer.

Index: gengtype-yacc.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gengtype-yacc.y,v
retrieving revision 1.13
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.13 gengtype-yacc.y
*** gengtype-yacc.y	30 May 2004 00:49:06 -0000	1.13
--- gengtype-yacc.y	23 Jun 2004 09:04:12 -0000
*************** option:   ID
*** 282,289 ****
  	    { $$ = create_option ($1, adjust_field_type ($3, NULL)); }
  	| NESTED_PTR '(' type ',' stringseq ',' stringseq ')'
  	    {
! 	      struct nested_ptr_data d =
! 	        { adjust_field_type ($3, NULL), $5, $7 };
  	      $$ = create_option ("nested_ptr",
  				  xmemdup (&d, sizeof (d), sizeof (d)));
  	    }
--- 282,292 ----
  	    { $$ = create_option ($1, adjust_field_type ($3, NULL)); }
  	| NESTED_PTR '(' type ',' stringseq ',' stringseq ')'
  	    {
! 	      struct nested_ptr_data d;
! 
! 	      d.type = adjust_field_type ($3, NULL);
! 	      d.convert_to = $5;
! 	      d.convert_from = $7;
  	      $$ = create_option ("nested_ptr",
  				  xmemdup (&d, sizeof (d), sizeof (d)));
  	    }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]