diff options
author | Marek Polacek <polacek@redhat.com> | 2014-04-30 06:14:39 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-04-30 06:14:39 +0000 |
commit | 8337d1db7113fa0c44541a1917529a0c41057a4a (patch) | |
tree | edc7cc5205725c68c2ab5c60851dedd9e4147750 /gcc/c | |
parent | c4bdc42f752a6fbff34c0bc75a907957afcbc431 (diff) | |
download | gcc-8337d1db7113fa0c44541a1917529a0c41057a4a.zip gcc-8337d1db7113fa0c44541a1917529a0c41057a4a.tar.gz gcc-8337d1db7113fa0c44541a1917529a0c41057a4a.tar.bz2 |
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
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 4 |
2 files changed, 8 insertions, 2 deletions
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 <polacek@redhat.com> + 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 <polacek@redhat.com> + 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 |