This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17129] New: all gcc fail to warn zero sized array.
- From: "ellson at research dot att dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Aug 2004 01:42:50 -0000
- Subject: [Bug c/17129] New: all gcc fail to warn zero sized array.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc35 fails to generate error for writes to zero sized array. This error
is detected by Sun's and SGI's compilers.
ellson@ontap:~> gcc35 --version
gcc35 (GCC) 3.5.0 20040715 (Red Hat 3.5.0-0.7)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ellson@ontap:~> cat bug.c
int main ()
{
int array[0];
array[0] = 1;
array[2] = 2;
return 0;
}
ellson@ontap:~> gcc35 -Wall bug.c
ellson@ontap:~>
--
Summary: all gcc fail to warn zero sized array.
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ellson at research dot att dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17129