public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/19977] overflow in non-static initializer should not be pedwarn
Date: Sun, 10 Dec 2006 17:18:00 -0000	[thread overview]
Message-ID: <20061210171756.9285.qmail@sourceware.org> (raw)
In-Reply-To: <bug-19977-230@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from manu at gcc dot gnu dot org  2006-12-10 17:17 -------
This patch seems to fix this. I get:

XPASS: gcc.dg/overflow-warn-3.c constant (test for bogus messages, line 42)
XPASS: gcc.dg/overflow-warn-4.c constant (test for bogus messages, line 42)

and no new failures on the overflow testcases.

I still have to properly bootstrap and regression test it. Any thoughts?

Index: gcc/c-typeck.c
===================================================================
--- gcc/c-typeck.c      (revision 119686)
+++ gcc/c-typeck.c      (working copy)
@@ -4358,7 +4360,7 @@ store_init_value (tree decl, tree init)

   /* ANSI wants warnings about out-of-range constant initializers.  */
   STRIP_TYPE_NOPS (value);
-  constant_expression_warning (value);
+  if (TREE_STATIC (decl)) constant_expression_warning (value);

   /* Check if we need to set array size from compound literal size.  */
   if (TREE_CODE (type) == ARRAY_TYPE


-- 


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


  parent reply	other threads:[~2006-12-10 17:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-19977-230@http.gcc.gnu.org/bugzilla/>
2006-12-09 14:28 ` manu at gcc dot gnu dot org
2006-12-10 17:18 ` manu at gcc dot gnu dot org [this message]
2006-12-15  1:15 ` patchapp at dberlin dot org
2007-01-02 20:08 ` manu at gcc dot gnu dot org
2007-01-06  9:37 ` manu at gcc dot gnu dot org
2005-02-15 22:31 [Bug c/19977] New: " jsm28 at gcc dot gnu dot org
2005-02-16  3:29 ` [Bug c/19977] " pinskia at gcc dot gnu dot 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=20061210171756.9285.qmail@sourceware.org \
    --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).