This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/74765] missing uninitialized warning (parenthesis, TREE_NO_WARNING abuse)
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 12 Aug 2016 15:07:38 +0000
- Subject: [Bug c++/74765] missing uninitialized warning (parenthesis, TREE_NO_WARNING abuse)
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-74765-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=74765
--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> I had plans to turn TREE_NO_WARNING/gimple_no_warning_p into on the side
> hashmap which would map trees or gimple stmts to bitmaps of OPT_W* flags
> that should be disabled, maybe that would help here.
For this particular case, the reason we set TREE_NO_WARNING is because we want
to warn for
if(i=0)
but we want to allow users to worki around the warning with:
if ((i=0))
There are other ways that we could suggest to work-around the warning, such as:
if(bool(a = 0))
or
if ( (a=0) != 0)
Note that the first one does warn, but the intent is clear.