[Bug c/33024] gcc allows negatively-sized arrays

drow at false dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 8 18:51:00 GMT 2007



------- Comment #10 from drow at gcc dot gnu dot org  2007-08-08 18:51 -------
Subject: Re:  gcc allows negatively-sized arrays

On Wed, Aug 08, 2007 at 05:34:47PM -0000, sdyoung at miranda dot org wrote:
> main() {
>   int y = 0xFFFFFFFD;
>   int x[y];
> }

This is roughly equivalent to malloc (4GB).  There is no requirement
on a C compiler to generate code for runtime bounds checking, and it
does not.


-- 


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



More information about the Gcc-bugs mailing list