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/53196] New: unknown struct name in C99 compound initializer doesn't generate error


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;
}


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