https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127408
Bug ID: 127408
Summary: gcc/gcov.cc:3424:23: warning: logical ‘and’ of
mutually exclusive tests is always false
[-Wlogical-op]
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Use of warning flag -Wlogical-op on a build produces
the warning message in the title.
The source code is
if (coverage->calls && coverage->calls == 0)
git blame says:
f6a1e69999d7 gcc/gcov.cc (Jørgen Kvalsvik 2025-09-30 11:23:56 +0200 3424)
if (coverage->calls && coverage->calls == 0)
This is yet another example where putting -Wlogical-op
into -Wall would have caught the problem earlier.