public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* anonymous structs in unions
@ 2003-02-27 12:38 Mihnea Balta
  2003-02-27 17:06 ` Dan Kegel
  0 siblings, 1 reply; 3+ messages in thread
From: Mihnea Balta @ 2003-02-27 12:38 UTC (permalink / raw)
  To: gcc-help

I've found out quite a while ago that gcc and g++ don't like constructs like:

union something{
   struct{
     int a, int b;
   };
   struct{
     float c, d;
   };
} a;

a.c = 12.f;

So far, the only place where I've gotten problems because of this was code 
that defined matrices as unions of a float array and a float struct, and that 
was quickly fixed by some #defines. Anyway, right now I have to port some 
visualc code to g++/linux and I stumbled across this problem in other areas 
which are harder to modify (mainly because the rest of the team members 
opposing to changing half their code :) and secondly because some hairy bit 
unions come into play).

My theoretical question is if this feature was not included in gcc/g++ because 
it does not comply with ANSI or for other reasons. My practical question is 
if anything can be done besides convincing my team mates to rewrite code or 
hacking gcc.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-28  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-27 12:38 anonymous structs in unions Mihnea Balta
2003-02-27 17:06 ` Dan Kegel
2003-02-28  7:57   ` Mihnea Balta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).