This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17515] New: invalid structure initializer accepted
- From: "andrae dot behrens at sms-demag dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2004 09:38:14 -0000
- Subject: [Bug c/17515] New: invalid structure initializer accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
/*
sim@linux:/tmp> gcc -c test2.c
sim@linux:/tmp> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-
prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-
languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable-
libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-
system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)
test2.c:
*/
#define NULL ((void*)0)
struct A {
int a1;
void* a2;
};
struct B {
struct A a;
int b;
};
struct B b1 = {{0,NULL},0};
struct B b2 = {0,0}; // compiler error missing !!!
--
Summary: invalid structure initializer accepted
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrae dot behrens at sms-demag dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: gcc -c test2.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17515