This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33024] gcc allows negatively-sized arrays
- From: "sdyoung at miranda dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Aug 2007 17:34:47 -0000
- Subject: [Bug c/33024] gcc allows negatively-sized arrays
- References: <bug-33024-14955@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from sdyoung at miranda dot org 2007-08-08 17:34 -------
Consider:
main() {
int x[0xFFFFFFFD];
}
fails to compile (array too large).
main() {
int y = 0xFFFFFFFD;
int x[y];
}
does compile. Somewhere, your error checking (or lack thereof) for VLAs is
broken. Unless I have just successfully allocated an array that is two bytes
shy of my entire virtual memory address space on a 32-bit architecture.
--
sdyoung at miranda dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33024