public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly
@ 2014-04-27 22:08 ppluzhnikov at google dot com
  2014-04-27 22:19 ` [Bug c++/60978] " ppluzhnikov at google dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-04-27 22:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60978
           Summary: [4.9 Regression] -Wenum-compare warns too eagerly
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Test case:

enum { A };
enum { B };

int foo(int x)
{
  return x ? A : B;
}

gcc -c -Wall t.c
# no warnings

g++ -c t.c
t.c: In function ‘int foo(int)’:
t.c:6:12: warning: enumeral mismatch in conditional expression: ‘<anonymous
enum>’ vs ‘<anonymous enum>’ [-Wenum-compare]
   return x ? A : B;
            ^

First, there is nothing to warn about here (in real code, I return IPPROTO_ICMP
or IPPROTO_ICMPV66 depending on address family).

Second, why is this pointing to the comparison and references enum-compare?
There is no comparison of unrelated enums here.
>From gcc-bugs-return-450009-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 27 22:13:22 2014
Return-Path: <gcc-bugs-return-450009-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16481 invoked by alias); 27 Apr 2014 22:13:22 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 16461 invoked by uid 48); 27 Apr 2014 22:13:18 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60978] [4.9 Regression] -Wenum-compare warns too eagerly
Date: Sun, 27 Apr 2014 22:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60978-4-2ubk0CKhSF@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02029.txt.bz2
Content-length: 342

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`978

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is documented to do this even in 4.8
(http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Warning-Options.html):
 In C++ enumeral mismatches in conditional expressions are also diagnosed and
the warning is enabled by default.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] [4.9 Regression] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
@ 2014-04-27 22:19 ` ppluzhnikov at google dot com
  2014-04-27 22:51 ` manu at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-04-27 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Andrew Pinski from comment #1)
> This is documented to do this even in 4.8
> (http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Warning-Options.html):
>  In C++ enumeral mismatches in conditional expressions are also diagnosed
> and the warning is enabled by default.

It also says "In C this warning is enabled by -Wall", but in fact "gcc -Wall"
does NOT warn.

In any case, warning when two *anonymous* enums are used like they are here to
return an integer seems of no value whatsoever.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] [4.9 Regression] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
  2014-04-27 22:19 ` [Bug c++/60978] " ppluzhnikov at google dot com
@ 2014-04-27 22:51 ` manu at gcc dot gnu.org
  2014-04-28 13:45 ` [Bug c++/60978] " ppluzhnikov at google dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2014-04-27 22:51 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

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

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
I don't even understand what this code is trying to warn about:

      if (TREE_CODE (arg2_type) == ENUMERAL_TYPE
      && TREE_CODE (arg3_type) == ENUMERAL_TYPE)
        {
      if (TREE_CODE (orig_arg2) == CONST_DECL
          && TREE_CODE (orig_arg3) == CONST_DECL
          && DECL_CONTEXT (orig_arg2) == DECL_CONTEXT (orig_arg3))
        /* Two enumerators from the same enumeration can have different
           types when the enumeration is still being defined.  */;
          else if (complain & tf_warning)
            warning_at (loc, OPT_Wenum_compare, "enumeral mismatch in "
            "conditional expression: %qT vs %qT",
            arg2_type, arg3_type);
        }

What is the DECL_CONTEXT check doing there?
>From gcc-bugs-return-450012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 27 22:59:18 2014
Return-Path: <gcc-bugs-return-450012-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11608 invoked by alias); 27 Apr 2014 22:59:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11579 invoked by uid 48); 27 Apr 2014 22:59:14 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60978] [4.9 Regression] -Wenum-compare warns too eagerly
Date: Sun, 27 Apr 2014 22:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60978-4-cJBf2xSpcN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02032.txt.bz2
Content-length: 1043

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

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #3)
> I don't even understand what this code is trying to warn about:
> 
>       if (TREE_CODE (arg2_type) == ENUMERAL_TYPE
> 	  && TREE_CODE (arg3_type) == ENUMERAL_TYPE)
>         {
> 	  if (TREE_CODE (orig_arg2) == CONST_DECL
> 	      && TREE_CODE (orig_arg3) == CONST_DECL
> 	      && DECL_CONTEXT (orig_arg2) == DECL_CONTEXT (orig_arg3))
> 	    /* Two enumerators from the same enumeration can have different
> 	       types when the enumeration is still being defined.  */;
>           else if (complain & tf_warning)
>             warning_at (loc, OPT_Wenum_compare, "enumeral mismatch in "
> 			"conditional expression: %qT vs %qT",
> 			arg2_type, arg3_type);
>         }
> 
> What is the DECL_CONTEXT check doing there?

No I remember it is because of
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53524#c19
>From gcc-bugs-return-450013-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 27 23:10:23 2014
Return-Path: <gcc-bugs-return-450013-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19306 invoked by alias); 27 Apr 2014 23:10:23 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19256 invoked by uid 48); 27 Apr 2014 23:10:20 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60978] [4.9 Regression] -Wenum-compare warns too eagerly
Date: Sun, 27 Apr 2014 23:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60978-4-zd7MfVgPqe@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02033.txt.bz2
Content-length: 843

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

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
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.

The reason it does not warn in C is that this particular warning message is not
implemented in C. Perhaps it should be.

The manual is a bit confusing. It would read better as:

Warn about a comparison between values of different enumerated types. In C this
warning is enabled by -Wall.  In C++ the warning is enabled by default and it
warns also about enumeral mismatches in conditional expressions.
>From gcc-bugs-return-450014-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Apr 28 03:55:58 2014
Return-Path: <gcc-bugs-return-450014-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18363 invoked by alias); 28 Apr 2014 03:55:57 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18324 invoked by uid 48); 28 Apr 2014 03:55:51 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60979] New: [4.9/4.10 Regression] ICE: in gimple_redirect_edge_and_branch_force, at tree-cfg.c:5544, w/ -O -ftree-loop-linear or fgraphite-identity
Date: Mon, 28 Apr 2014 03:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-60979-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-04/txt/msg02034.txt.bz2
Content-length: 1630

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`979

            Bug ID: 60979
           Summary: [4.9/4.10 Regression] ICE: in
                    gimple_redirect_edge_and_branch_force, at
                    tree-cfg.c:5544, w/ -O -ftree-loop-linear or
                    fgraphite-identity
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com

gcc 4.9.0 and newer fails when compiling the following reduced testcase w/ -O1
and above and either -ftree-loop-linear or -fgraphite-identity:

typedef long int __jmp_buf[8];

typedef struct
{
  unsigned long int __val[(1024 / (8 * sizeof(unsigned long int)))];
} __sigset_t;

struct __jmp_buf_tag
{
  __jmp_buf __jmpbuf;
  int __mask_was_saved;
  __sigset_t __saved_mask;
};

typedef struct __jmp_buf_tag jmp_buf[1];

extern int _setjmp(struct __jmp_buf_tag __env[1]);

struct x;

typedef struct x **(*a)(struct x *);

struct x {
  union {
    struct {
      union {
        a *i;
      } l;
      int s;
    } y;
  } e;
};

jmp_buf c;

void
b(struct x *r)
{
  int f;
  static int w = 0;
  volatile jmp_buf m;
  f = (*(((struct x *)r)->e.y.l.i[2]((struct x *)r)))->e.y.s;
  if (w++ != 0)
    memcpy((char *)m, (const char *)c, sizeof(jmp_buf));
  if (_setjmp(c) == 0) {
    int z;
    for (z = 0; z < 0; ++z)
      ;
  }
  d((const char *)m);
}

nl8dmqci.c:37:1: internal compiler error: in
gimple_redirect_edge_and_branch_force, at tree-cfg.c:5544
 b(struct x *r)
 ^


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
  2014-04-27 22:19 ` [Bug c++/60978] " ppluzhnikov at google dot com
  2014-04-27 22:51 ` manu at gcc dot gnu.org
@ 2014-04-28 13:45 ` ppluzhnikov at google dot com
  2014-12-02 22:01 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-04-28 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Richard Biener from comment #6)
> Warns since forever (checked up to GCC 4.3.x), confirmed.

Interesting. In my non-reduced test case, the warning is new with gcc-4.9.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2014-04-28 13:45 ` [Bug c++/60978] " ppluzhnikov at google dot com
@ 2014-12-02 22:01 ` jason at gcc dot gnu.org
  2014-12-02 22:23 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-12-02 22:01 UTC (permalink / raw)
  To: gcc-bugs

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.
>From gcc-bugs-return-469263-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Dec 02 22:11:18 2014
Return-Path: <gcc-bugs-return-469263-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24246 invoked by alias); 2 Dec 2014 22:11:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24191 invoked by uid 48); 2 Dec 2014 22:11:12 -0000
From: "ppluzhnikov at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60978] -Wenum-compare warns too eagerly
Date: Tue, 02 Dec 2014 22:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ppluzhnikov at google dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60978-4-FZs6InXmof@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60978-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-12/txt/msg00270.txt.bz2
Content-length: 985

https://gcc.gnu.org/bugzilla/show_bug.cgi?id`978

--- 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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2014-12-02 22:01 ` jason at gcc dot gnu.org
@ 2014-12-02 22:23 ` jason at gcc dot gnu.org
  2014-12-02 22:33 ` ppluzhnikov at google dot com
  2014-12-03  1:29 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-12-02 22:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Paul Pluzhnikov from comment #9)
> In glibc-2.19, include/netinet/in.h:

Interesting, in glibc 2.18 (at least in glibc-headers-2.18-16.fc20.x86_64) they
are in the same enum.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2014-12-02 22:23 ` jason at gcc dot gnu.org
@ 2014-12-02 22:33 ` ppluzhnikov at google dot com
  2014-12-03  1:29 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-12-02 22:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Jason Merrill from comment #10)

> Interesting, in glibc 2.18 (at least in glibc-headers-2.18-16.fc20.x86_64)
> they are in the same enum.

The in.h is actually part of kernel, not glibc itself.
We used linux-3.12.6 "make headers_install" to get include/netinet/in.h.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/60978] -Wenum-compare warns too eagerly
  2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2014-12-02 22:33 ` ppluzhnikov at google dot com
@ 2014-12-03  1:29 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-12-03  1:29 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Closing then.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-03  1:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-27 22:08 [Bug c++/60978] New: [4.9 Regression] -Wenum-compare warns too eagerly ppluzhnikov at google dot com
2014-04-27 22:19 ` [Bug c++/60978] " ppluzhnikov at google dot com
2014-04-27 22:51 ` manu at gcc dot gnu.org
2014-04-28 13:45 ` [Bug c++/60978] " ppluzhnikov at google dot com
2014-12-02 22:01 ` jason at gcc dot gnu.org
2014-12-02 22:23 ` jason at gcc dot gnu.org
2014-12-02 22:33 ` ppluzhnikov at google dot com
2014-12-03  1:29 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).