http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52635
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-20 14:31:16 UTC --- I don't think this is a bug. For -std=c89 -pedantic-errors you get a proper error - C89 doesn't have VLAs, but otherwise when optimizing the type is considered just as a VLA type. You don't get any diagnostic even when you actually use the sizeof (e.g. return it from the function), negative VLA size doesn't have any diagnostic (most often it isn't even possible to diagnose it at compile time).