* c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
commitc9e51d2533522d8bf5e4d020295966a37708a5b2
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 May 2014 20:03:57 +0000 (10 20:03 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 May 2014 20:03:57 +0000 (10 20:03 +0000)
treefdf170b705a741473342bef1cba458b93231ff9f
parente34b778b1bef4239e91bada5628280750a7b1b3e
* c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
maybe_warn_string_init.
(c_parser_postfix_expression_after_paren_type): Pass type_loc to
maybe_warn_string_init.
* c-tree.h (maybe_warn_string_init): Update declaration.
* c-typeck.c (maybe_warn_string_init): Add location parameter.
Call pedwarn_init with loc instead of with input_location.
(digest_init): Pass init_loc to maybe_warn_string_init.
(pop_init_level): Call pedwarn_init with loc instead of with
input_location.
(set_init_index): Likewise.
(process_init_element): Likewise.

* gcc.dg/pedwarn-init.c: New test.
* gcc.dg/init-string-1.c: Adjust dg-error.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210300 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/init-string-1.c
gcc/testsuite/gcc.dg/pedwarn-init.c [new file with mode: 0644]