From 8337d1db7113fa0c44541a1917529a0c41057a4a Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Wed, 30 Apr 2014 06:14:39 +0000 Subject: re PR c/60139 (Imprecise column number for -pedantic on non-computable initializer element) PR c/60139 * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn and pedwarn_init. Use loc insted of input_location. * gcc.dg/pr60139.c: New test. From-SVN: r209926 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-typeck.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ee7c9be..d54b62e 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,11 @@ 2014-04-30 Marek Polacek + PR c/60139 + * c-typeck.c (output_init_element): Pass OPT_Wpedantic to pedwarn + and pedwarn_init. Use loc insted of input_location. + +2014-04-30 Marek Polacek + PR c/60351 * c-typeck.c (build_binary_op): Use location when warning about shift count. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index e23c6db..6e56b69 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -8255,12 +8255,12 @@ output_init_element (location_t loc, tree value, tree origtype, value = error_mark_node; } else if (require_constant_elements) - pedwarn (input_location, 0, + pedwarn (loc, OPT_Wpedantic, "initializer element is not computable at load time"); } else if (!maybe_const && (require_constant_value || require_constant_elements)) - pedwarn_init (input_location, 0, + pedwarn_init (loc, OPT_Wpedantic, "initializer element is not a constant expression"); /* Issue -Wc++-compat warnings about initializing a bitfield with -- cgit v1.1