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

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 8 17:27:00 GMT 2007



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-08-08 17:27 -------
>should not segfault (which it does).

Not when you consider the stack pointer will wrap and increase (instead of
decrease) by 8.

Again this is only undefined C99.  (this code is invalid C90 and C++98 anyways
as variable length arrays are not in C90/C++98).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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



More information about the Gcc-bugs mailing list