[Bug c/31871] New: C99 failure to diagnose non-integer cast

neil at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue May 8 23:12:00 GMT 2007


Casts to "void *" are not permitted in integer constant expressions.

Therefore this code violates constraint 6.7.5.2p2 of C99 (C90 is u.b.) and so
must be diagnosed.

extern int c[1 + ((int) (void *) 0)];


-- 
           Summary: C99 failure to diagnose non-integer cast
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: neil at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list