public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kugan at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/66066] [6 Regression] r222889 causes bogus error: initializer element is not constant
Date: Sat, 09 May 2015 12:20:00 -0000	[thread overview]
Message-ID: <bug-66066-4-fSzbNLhPm1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66066-4@http.gcc.gnu.org/bugzilla/>

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

kugan at gcc dot gnu.org changed:

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

--- Comment #5 from kugan at gcc dot gnu.org ---
I ran into this today when I created a cross compiler for aarch64-linux-gnu. It
also happens with arm. As Richard Biener suggested, -pedantic helps. How about
this:

diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 3fcb7c2..d5d82fd 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -10702,7 +10702,7 @@ build_binary_op (location_t location, enum tree_code
code,
            {
              /* Don't reject a left shift of a negative value in a context
                 where a constant expression is needed in C90.  */
-             if (flag_isoc99)
+             if (flag_isoc99 && pedantic)
                int_const = false;
              if (c_inhibit_evaluation_warnings == 0)
                warning_at (location, OPT_Wshift_negative_value,


  parent reply	other threads:[~2015-05-09 12:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08  6:04 [Bug c/66066] New: " trippels at gcc dot gnu.org
2015-05-08  7:37 ` [Bug c/66066] " mpolacek at gcc dot gnu.org
2015-05-08  8:11 ` mpolacek at gcc dot gnu.org
2015-05-08 10:49 ` rguenth at gcc dot gnu.org
2015-05-08 10:50 ` rguenth at gcc dot gnu.org
2015-05-09 12:20 ` kugan at gcc dot gnu.org [this message]
2015-05-11 13:09 ` vp at gcc dot gnu.org
2015-05-12  9:47 ` rohitarulraj at gmail dot com
2015-05-12 10:22 ` clyon at gcc dot gnu.org
2015-05-12 15:56 ` mpolacek at gcc dot gnu.org
2015-05-12 16:07 ` manu at gcc dot gnu.org
2015-05-12 16:24 ` mpolacek at gcc dot gnu.org
2015-05-12 16:30 ` manu at gcc dot gnu.org
2015-05-12 19:09 ` mpolacek at gcc dot gnu.org
2015-05-13 15:22 ` sje at gcc dot gnu.org
2015-05-13 15:27 ` mpolacek at gcc dot gnu.org
2015-05-14 11:43 ` mpolacek at gcc dot gnu.org
2015-05-14 11:44 ` mpolacek at gcc dot gnu.org
2015-05-14 11:44 ` mpolacek 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-66066-4-fSzbNLhPm1@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).