OSDN Git Service

* c-typeck.c (digest_init): Don't allow arrays of signed or
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Jul 2004 09:12:21 +0000 (09:12 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Jul 2004 09:12:21 +0000 (09:12 +0000)
commite91a0d3964d0faa773ac2091b989c5747b19971e
tree679b0177e461b3f53a6306601674dd0b3935125b
parent540edea7db8adb1cf64f022750998ec3fe4181a2
* c-typeck.c (digest_init): Don't allow arrays of signed or
unsigned variants of wchar_t to be initialized by wide string
constants.  Do allow arrays of enumerated types compatible with
wchar_t to be initialized by wide string constants.  Refine tests
distinguishing wide and narrow strings and arrays.  Give specific
error for arrays of other integer types initialized by string
constants.
(output_init_element, process_init_element): Check for
INTEGRAL_TYPE_P rather than just for INTEGER_TYPE when
initializing with string constants.

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

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