This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60978] -Wenum-compare warns too eagerly
- From: "ppluzhnikov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Dec 2014 22:11:10 +0000
- Subject: [Bug c++/60978] -Wenum-compare warns too eagerly
- Auto-submitted: auto-generated
- References: <bug-60978-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60978
--- Comment #9 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Jason Merrill from comment #8)
> You shouldn't get the warning about IPPROTO_ICMP vs IPPROTO_ICMPV66, as they
> are members of the same anonymous enum.
They are?
In glibc-2.19, include/netinet/in.h:
/* Standard well-defined IP protocols. */
enum
{
IPPROTO_IP = 0, /* Dummy protocol for TCP. */
#define IPPROTO_IP IPPROTO_IP
IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */
#define IPPROTO_ICMP IPPROTO_ICMP
...
};
/* If __USE_KERNEL_IPV6_DEFS is defined then the user has included the kernel
network headers first and we should use those ABI-identical definitions
instead of our own. */
#ifndef __USE_KERNEL_IPV6_DEFS
enum
{
IPPROTO_HOPOPTS = 0, /* IPv6 Hop-by-Hop options. */
...
IPPROTO_ICMPV6 = 58, /* ICMPv6. */
...
};
Looks like different anonymous enums to me.