This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53196] New: unknown struct name in C99 compound initializer doesn't generate error
- From: "lzie59p1 at frolickingcow dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 May 2012 17:55:27 +0000
- Subject: [Bug c/53196] New: unknown struct name in C99 compound initializer doesn't generate error
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53196
Bug #: 53196
Summary: unknown struct name in C99 compound initializer
doesn't generate error
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: lzie59p1@frolickingcow.net
I think this code shouldn't compile (see foo_typo). It compiles on 4.5.3 and
4.7.0.
#include <stdio.h>
struct foo {
int i;
};
int
main(void)
{
struct foo f = (struct foo_typo) { };
printf("%d\n", f.i);
return 0;
}