This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C PATCH: excess initializer elements



> 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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]