[Bug c++/12615] [3.3 Regression] initializer syntax for POD structs gives parse error

bruno at clisp dot org gcc-bugzilla@gcc.gnu.org
Wed Oct 15 10:44:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12615



------- Additional Comments From bruno at clisp dot org  2003-10-15 10:44 -------
Gabriel dos Reis writes: 
> There is a standard way to express an equivalent construct.  I  would strongly 
> suggest you use it. 
 
The problem with this is that it is not a syntax which is valid in initializers _and_ 
expressions. I'd need to write 
 
void gc_mark (object obj) 
{ 
  // Initializer syntax 
  object a = { one_o: 0, allocstamp: 0 }; 
  // Expression syntax 
  object b; b = (object) { one_o: 0, allocstamp: 0 }; 
} 
 
This means that for all of my macros returning a constructed 'object', I'd need 
two variants: one for use in initializers and one for use in expressions. This is 
not reasonable. 
 
Can't you give me a syntax which 
  - works both in expressions and initializers, 
  - preferrably also works the same way in GNU C?



More information about the Gcc-bugs mailing list