This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11250] -pedantic accepts `char a[] = ("x");'
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2004 23:46:32 -0000
- Subject: [Bug c/11250] -pedantic accepts `char a[] = ("x");'
- References: <20030619113424.11250.h.b.furuseth@usit.uio.no>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-07-21 23:46 -------
Subject: Bug 11250
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: jsm28@gcc.gnu.org 2004-07-21 23:46:21
Modified files:
gcc : ChangeLog c-parse.in c-tree.h c-typeck.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg: init-string-1.c
Log message:
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.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4627&r2=2.4628
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&r1=1.223&r2=1.224
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.164&r2=1.165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.343&r2=1.344
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4031&r2=1.4032
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/init-string-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11250