aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2015-05-14 11:42:53 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2015-05-14 11:42:53 +0000
commit3aa3c9fc9a5f82f23717386df7fa342e0a89b627 (patch)
treef48930586f2a03d6d44f7e85c4dfe7f4f6c23873 /gcc/c
parent12b3286d41a6aedba8e295a7c7934ec124904b55 (diff)
downloadgcc-3aa3c9fc9a5f82f23717386df7fa342e0a89b627.zip
gcc-3aa3c9fc9a5f82f23717386df7fa342e0a89b627.tar.gz
gcc-3aa3c9fc9a5f82f23717386df7fa342e0a89b627.tar.bz2
re PR c/66066 (r222889 causes bogus error: initializer element is not constant)
PR c/66066 PR c/66127 * c-common.c (c_fully_fold): Pass false down to c_fully_fold_internal. (c_fully_fold_internal): Fold C_MAYBE_CONST_EXPRs with C_MAYBE_CONST_EXPR_INT_OPERANDS set. Add FOR_INT_CONST argument and use it. If FOR_INT_CONST, require that all evaluated operands be INTEGER_CSTs. * c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic rather than with 0. * gcc.dg/pr14649-1.c: Add -Wpedantic. * gcc.dg/pr19984.c: Likewise. * gcc.dg/pr66066-1.c: New test. * gcc.dg/pr66066-2.c: New test. * gcc.dg/pr66066-3.c: New test. From-SVN: r223193
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog7
-rw-r--r--gcc/c/c-typeck.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index f1c4073..ebf9759 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-14 Marek Polacek <polacek@redhat.com>
+
+ PR c/66066
+ PR c/66127
+ * c-typeck.c (digest_init): Call pedwarn_init with OPT_Wpedantic
+ rather than with 0.
+
2015-05-12 David Malcolm <dmalcolm@redhat.com>
* c-parser.c (c_parser_if_body): Add param "if_loc", use it
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 3fcb7c2..9b883a2 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -6864,7 +6864,7 @@ digest_init (location_t init_loc, tree type, tree init, tree origtype,
inside_init = error_mark_node;
}
else if (require_constant && !maybe_const)
- pedwarn_init (init_loc, 0,
+ pedwarn_init (init_loc, OPT_Wpedantic,
"initializer element is not a constant expression");
/* Added to enable additional -Wsuggest-attribute=format warnings. */