[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] anonymous structs and C99



Hi,

That kind of syntax is a Microsoft extension ;-)
You can use it along with -std=c99 if you add -fms-extensions
Well, if you want to be standard compliant, it is not a good idea.
I agree, I don't like non-standard C code, too. VC++ drives me crazy, its C compiler lacks C99 declarations in the middle of function body so I must declare all variables at the beginning, awful. Funny that '//' comments are ok. (yes I know I can compile it as C++ code but this isn't solution)
 
Then you can use a.u.pointer1
Of course, no cast is required !
Yes but it involves that 'u' everytime, it has no use for programmer since it's dummy variable and only makes code worser to understand (but one could say the same about this union trick / extension :)

Btw Mariusz: naming that union caused gcc to complain even in non-C99 mode, the same error :)

Anyway, thank you for your help, it seems I must learn to live with that additional union name...

--
MiKRO / Mystic Bytes
http://mikro.atari.org