This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52635] gcc fails to diagnose invalid type in unused sizeof() when optimizing
- From: "mikpe at it dot uu.se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Mar 2012 19:09:01 +0000
- Subject: [Bug c/52635] gcc fails to diagnose invalid type in unused sizeof() when optimizing
- Auto-submitted: auto-generated
- References: <bug-52635-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52635
--- Comment #5 from Mikael Pettersson <mikpe at it dot uu.se> 2012-03-20 19:09:01 UTC ---
(In reply to comment #4)
> Not sure what kernel you are looking at, but in current kernel at least since
> 2009-09 BUILD_BUG_ON is BUILD_BUG_ON_ZERO and only MAYBE_BUILD_BUG_ON macro is
> using this sizeof and from the description it sounds like it wants the warnings
> only if the condition is known to be false already during parsing.
I'm looking at the 3.3 kernel released only a few days ago. It's kernel.h
doesn't define BUILD_BUG_ON in terms of BUILD_BUG_ON_ZERO (which perhaps it
should be) and there is no MAYBE_BUILD_BUG_ON anywhere.