This is the mail archive of the gcc-bugs@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]

[Bug c/11306] New: unnamed struct bugs in gcc


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

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

           Summary: unnamed struct bugs in gcc
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: msegura at emn dot fr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: 2.4.182 3
  GCC host triplet: Linux  i686 GNU/Linux
GCC target triplet: Linux  i686 GNU/Linux

using gcc 3.3 (
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i386-linux
Thread model: posix )
the following code failed to compile:
       struct Test {
         int b;
         float c;
       } ;

 struct {
       int a;
	struct Test t ;
       int d;
     } foo;

int main() {
	return foo.b;
}
It compiles perfectly with gcc-3.2.
The manual
(http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Unnamed-Fields.html#Unnamed%20Fields)
implies that this code should be correct (despite the fact that "Such constructs
are not supported and must be avoided. In the future, such constructs may be
detected and treated as compilation errors.")
Cheers,

Marc


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