This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77298] -Wnonnull-compare only emitted for code which is invoked
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Aug 2016 17:33:22 +0000
- Subject: [Bug c++/77298] -Wnonnull-compare only emitted for code which is invoked
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-77298-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77298
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Yes, that makes sense to me as an explanation of the limitation of the GCC
implementation and a solution/workaround for it. I don't think it's something
users unfamiliar with GCC internals think of, though. I don't have a sense of
how much work it would be to change GCC to issue these warnings consistently,
whether or not functions are used, but I suspect it's not a trivial "bug fix."
Until this change is made (if it ever is made), it seems that documenting the
limitation and the -fkeep-inline-functions workaround might help users who are
relying on these warnings to be consistent. If you all agree I volunteer to
reopen thus bug and add something to the manual. Yes?