This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Undetected error in array declarations...
- To: egcs-bugs at cygnus dot com
- Subject: Undetected error in array declarations...
- From: Mike Simons <msimons at fsimons01 dot erols dot com>
- Date: Wed, 2 Dec 1998 12:45:03 -0500 (EST)
Hello all,
If a function call is given as a array size, the compiler uses a size of 8.
Even when "-Wall -W" is used, there are no messages about a function call in
array definitions being illegal.
I think the compiler should flag this as an error... or if for some reason
that may be valid syntax, at the very least issue a warning when -Wall is on.
Thanks,
Mike Simons
compiler used:
msimons@gabriel:~> egcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.58/specs
gcc version egcs-2.91.58 19981101 (egcs-1.1.1 pre-release 2, Debian 2.1)
...but I have tried this with various versions of gcc 2.7.* through the
egcs version given above.
here is an example:
===========
#include <string.h>
int main(void)
{
int foo[strlen("something really long")];
int bar[strlen("")][10];
int baz[10][strlen("")];
return 0;
}