This is the mail archive of the 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


           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
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.")


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