This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: anonymous structures within a union do not compile by c++ compiler
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Alex Babkin <ababkin at ati dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 06 Jun 2004 21:51:36 -0700
- Subject: Re: anonymous structures within a union do not compile by c++ compiler
- References: <40BE40FC.10408@ati.com>
Alex Babkin wrote:
the following code compiles if the source file uses .c extension with
the usual "gcc -o out source.c" command but would not compie if i rename
the file to .cpp extension.
The C and C++ front ends are separate. Sometimes language extensions
get added to one but not the other. This appears to be the situation in
this case. The extension is in the C front end, but not the C++ front end.
There may also be C++ language issues that prevent this working in C++.
If you try using -pedantic, you will get warnings. This shows that the
testcase is using GNU C language extensions.
You could try submitting a bug report asking for the same extension to
be added to the C++ front end.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com