re PR c/11250 (-pedantic accepts `char a[] = ("x");')
authorJoseph Myers <jsm@polyomino.org.uk>
Wed, 21 Jul 2004 23:46:20 +0000 (00:46 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Wed, 21 Jul 2004 23:46:20 +0000 (00:46 +0100)
commit916c59199cfbe12788cef6ad2b7cb8ffdc59af71
tree3445b1b5b70b8f6f28f797b70463fa6e393fa8e1
parentbf6c40e92d589b24583ef6e5494bd17a78c13033
re PR c/11250 (-pedantic accepts `char a[] = ("x");')

PR c/11250
* c-parse.in (init): Change to exprtype.
(primary): Set original_code for STRING to STRING_CST.
Call maybe_warn_string_init for compound literals.
(initdcl, notype_initdcl): Call maybe_warn_string_init.
(initval): Update.
* c-tree.h (maybe_warn_string_init): New.
(pop_init_level, process_init_element): Use struct c_expr.
(struct c_expr): Update comment.
* c-typeck.c (maybe_warn_string_init): New function.
(digest_init): Call it.  Additional parameter strict_string.  All
callers changed.
(output_init_element): Likewise.
(struct constructor_stack): Use struct c_expr for
replacement_value.
(really_start_incremental_init, push_init_level): Update.
(pop_init_level): Update.  Return struct c_expr.
(process_init_level): Update.  Take struct c_expr argument.

testsuite:
* gcc.dg/init-string-1.c: New test.

From-SVN: r85022
gcc/ChangeLog
gcc/c-parse.in
gcc/c-tree.h
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/init-string-1.c [new file with mode: 0644]