https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
Martin Liška changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
--- Comment #7 from Jörg Richter ---
Yes, I changed our code already to
if( C != Enum() )
But I still think that an explicit cast should always silence this warning.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
--- Comment #6 from Bernd Edlinger ---
(In reply to Jörg Richter from comment #5)
> There needs to be at least a way to suppress the warning with a cast
> or some other construct (not pragma).
That is simple: if ( C != A ) ...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
--- Comment #5 from Jörg Richter ---
There needs to be at least a way to suppress the warning with a cast
or some other construct (not pragma).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
--- Comment #4 from Jonathan Wakely ---
The warning was introduced for PR 77434 and the current behaviour by the fix
for PR 77700.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
Jonathan Wakely changed:
What|Removed |Added
CC||edlinger at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
--- Comment #2 from Jörg Richter ---
The only boolean context I see is the if(...).
The if() is never used with enum constants/types, but only bool-s and int-s.
So according to the warning name (int-in-bool-context) the warning can
be expected in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91964
--- Comment #1 from Jonathan Wakely ---
(In reply to Jörg Richter from comment #0)
> I think all warnings are wrong because nowhere is a enum constant in a
> boolean context.
The warning is documented as diagnosing "using non-boolean integer con