Implement -Wduplicated-branches (PR c/64279)

Jason Merrill
Thu Oct 20 14:12:00 GMT 2016

On Wed, Oct 19, 2016 at 7:07 AM, Marek Polacek <> wrote:
> But since integer csts and various decls
> don't carry location info, this works only partially, so the warning
> warns even for e.g.
>   if (TREE_STATIC (node) || DECL_EXTERNAL (node))
>     max_align = MAX_OFILE_ALIGNMENT;
>   else
>     max_align = MAX_STACK_ALIGNMENT;
> when MAX_OFILE_ALIGNMENT and MAX_STACK_ALIGNMENT represent the same number.
> There's no way to get around this, so the warning isn't enabled by nor
> -Wall neither -Wextra, and can't be until we solve the pesky location
> horror.  (-Wduplicated-cond is off for the very same reason.)

Is someone working on this?


More information about the Gcc-patches mailing list