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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |paolo.carlini at oracle dot com

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #5)
> I think it should not warn for anonymous enums. The point of the warning is
> that using different enum types in a conditional expression is often some
> programming mistake. But in the case of anonymous enums, they are probably
> just used as named constants, so there is no much point in warning.

I don't think I agree.  Even with anonymous enums there is the risk that, as in
the reduced testcase here, you end up returning the same value by different
names.

You shouldn't get the warning about IPPROTO_ICMP vs IPPROTO_ICMPV66, as they
are members of the same anonymous enum.  If 4.9 started complaining, that's the
bug.

Reply via email to