This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31871] New: C99 failure to diagnose non-integer cast
- From: "neil at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 May 2007 23:11:48 -0000
- Subject: [Bug c/31871] New: C99 failure to diagnose non-integer cast
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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