From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10406 invoked by alias); 30 May 2012 16:29:27 -0000 Received: (qmail 10393 invoked by uid 22791); 30 May 2012 16:29:24 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 May 2012 16:29:09 +0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53524] [4.7/4.8 Regression] Bogus and unsuppressible enum comparison warning Date: Wed, 30 May 2012 16:45: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-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com X-Bugzilla-Target-Milestone: 4.7.1 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg02870.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53524 --- Comment #8 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2012-05-30 16:29:08 UTC --- (In reply to comment #6) > The warnings are an unintended effect of my fix for PR16603. So, before your fix, same_type_p was returning true?=20 enum { e1 =3D -1 }; enum { e2 =3D -1 }; int j; void foo(void) { j =3D 0 ? e1 : e2; } g++ 4.3.2 tt.cc:6: warning: enumeral mismatch in conditional expression: =E2=80=98=E2=80=99 vs =E2=80=98=E2=80=99 So, the warning is intended, and the fact that we did not warn before was a bug. However, it is not clear to me how this code can be dangerous. But the warning is very very old. r29056 | nathan | 1999-09-02 11:21:42 +0200 (Thu, 02 Sep 1999) | 4 lines * call.c (build_conditional_expr): Warn on enum mismatches. (convert_arg_to_ellipsis): Move non-pod check to after conversion.