[Bug c/91915] New warning for duplicate if condition in if-elseif-elseif chain

egallager at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 26 15:41:00 GMT 2019


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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #2)
> I already implemented such a warning in r228388:
> 
> w.c: In function ‘foo’:
> w.c:11:17: warning: duplicated ‘if’ condition [-Wduplicated-cond]
>    11 |   else if (argc == 1)
>       |            ~~~~~^~~~
> w.c:6:12: note: previously used here
>     6 |   if (argc == 1)
>       |       ~~~~~^~~~

so in that case this would be bug 87656


More information about the Gcc-bugs mailing list