This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/52635] gcc fails to diagnose invalid type in unused sizeof() when optimizing


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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]