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++/74765] missing uninitialized warning (parenthesis, TREE_NO_WARNING abuse)


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.

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