public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53524] [4.7/4.8 Regression] Bogus and unsuppressible enum comparison warning
Date: Thu, 31 May 2012 03:01:00 -0000	[thread overview]
Message-ID: <bug-53524-4-k4UeMhYt4s@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53524-4@http.gcc.gnu.org/bugzilla/>

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

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

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

--- Comment #14 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-05-31 00:58:14 UTC ---
I'm reviewing the whole thing. To summarize my understanding:

When we emit the warning, arg2_type and arg3_type are the types of arg2 and
arg3, thus, post PR16603, exactly the types of the two initializing
expressions, because we are still defining the enumerator NumLowBitsAvailable
of the same enum and the enum is not complete. And indeed, those types are
*different* as the warning says. Thus, it seems to me, the warning is behaving
as designed, just, post PR16603, it triggers also while we are defining
individual enumerators basing on other enumerators of the same enum. Of course
this didn't happen before PR16603 because we weren't honoring the two-phase
typing mechanism. Then it seems to me that we have nothing to strictly-speaking
"fix", but only to agree on how we want to put the warning under control. I'm
tempted to propose again just to add a -Wenum-mismatch, I note that the EDG
front-end doesn't warn with -Wall for the reference very simple case discussed
in Comments #7 and #8. I *do* understand that ideally we would like to tell the
code in build_conditional_expr_1: "hey we are comparing the types of the
initializing expressions of two enumerators of the same enum, which are
different, but the difference will go away at the end of the enum when we'll
have a single underlying type, thus please don't warn now" but I don't see a
simple way to do this: if, for example, we just compare underlying types, we
suppress a lot of other warnings, like the one in Comment #7. Given what I see
for EDG (what about CLANG?), I'm not sure we should spend a lot of time right
now tuning the mechanism of the warning itself.


  parent reply	other threads:[~2012-05-31  0:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  1:53 [Bug c++/53524] New: [4.7/4.8 Regression] Bogus and unsupressable " ppluzhnikov at google dot com
2012-05-30  2:25 ` [Bug c++/53524] " pinskia at gcc dot gnu.org
2012-05-30  2:59 ` jyasskin at gcc dot gnu.org
2012-05-30  4:45 ` crowl at google dot com
2012-05-30  8:17 ` manu at gcc dot gnu.org
2012-05-30  8:54 ` [Bug c++/53524] [4.7/4.8 Regression] Bogus and unsuppressible " paolo.carlini at oracle dot com
2012-05-30  9:54 ` rguenth at gcc dot gnu.org
2012-05-30 10:35 ` paolo.carlini at oracle dot com
2012-05-30 11:14 ` paolo.carlini at oracle dot com
2012-05-30 16:45 ` manu at gcc dot gnu.org
2012-05-30 17:37 ` paolo.carlini at oracle dot com
2012-05-30 17:42 ` crowl at google dot com
2012-05-30 17:43 ` crowl at google dot com
2012-05-30 17:55 ` manu at gcc dot gnu.org
2012-05-30 18:43 ` paolo.carlini at oracle dot com
2012-05-31  3:01 ` paolo.carlini at oracle dot com [this message]
2012-05-31 17:33 ` crowl at google dot com
2012-05-31 18:05 ` paolo.carlini at oracle dot com
2012-05-31 21:14 ` crowl at google dot com
2012-05-31 21:24 ` paolo.carlini at oracle dot com
2012-05-31 21:42 ` ppluzhnikov at google dot com
2012-06-04 19:28 ` paolo at gcc dot gnu.org
2012-06-04 20:31 ` paolo at gcc dot gnu.org
2012-06-13 13:50 ` rguenth at gcc dot gnu.org
2012-06-13 14:01 ` paolo.carlini at oracle dot com
2012-06-14  8:11 ` rguenth at gcc dot gnu.org
2012-06-19 21:57 ` ppluzhnikov at google dot com
2012-06-25 15:51 ` [Bug c++/53524] [4.7/4.8 Regression] Bogus " jason at gcc dot gnu.org
2012-07-02 19:15 ` jason at gcc dot gnu.org
2012-07-02 19:24 ` jason at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53524-4-k4UeMhYt4s@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).