https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80151

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #11 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Jonathan Wakely from comment #10)
> If you want a new warning for those cases, it needs to be properly described
> to say when it should warn *and when it should not*, to avoid unhelpful
> warnings for the cases like comment 5 and comment 7.

I could be misunderstanding but I think Jonny is asking for an off-by-default
warning that is not meant to be useful for general code, that is meant to only
be useful for code written in a particular style with extra restrictions, and
it is okay for it to also warn for the code in comment 5 and comment 7 because
that style would have users write if (strlen(str) != 0) rather than if
(strlen(str)).

Given that this bug is asking for a warning that could be enabled by default or
included in -Wall, I think that that is a separate issue and best covered in a
different bug if I'm understanding Jonny's request right, but I can see the
value in that option.

Reply via email to