This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C PATCH: excess initializer elements
- To: Nathan Sidwell <nathan at acm dot org>
- Subject: C PATCH: excess initializer elements
- From: Gavin Romig-Koch <gavin at cygnus dot com>
- Date: Fri, 11 Jun 1999 14:48:54 -0400 (EDT)
- CC: egcs-patches at egcs dot cygnus dot com, Robert dot Harley at inria dot fr
> 1999-05-06 Nathan Sidwell <nathan@acm.org>
>
> * c-typeck.c (process_init_element): Detect excess elements in
> char array initializer.
>
> ok to install?
Yes, thanks. Sorry this took so long.
> I think the special handling of `char ary[] = {"init"};' as `char ary[] =
> "init";' is wrong, but all I've got is K&R2 which allows a string initializer,
> not mentioning a braced string initializer (A8.7).
ANSI/ISO allows this:
3.7.5:
An array of character type may be initialized by a character string literal,
optionally enclosed in braces.
(There is a similar rule for scalers.)
-gavin...