From: SourceForge.net <no...@so...> - 2007-12-04 00:01:17
|
Bugs item #1843745, was opened at 2007-12-04 02:01 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1843745&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Sergey A. Borshch (sb-sf) Assigned to: Nobody/Anonymous (nobody) Summary: pic16: invalid initialization of incomplete arrays in struct Initial Comment: if two or more structs with incomplete arrays initialized in same source file, size of arrays corresponds to size of array of first structure, not to to size of current array: #include <stdint.h> typedef struct { uint8_t a; uint8_t Data[]; } test_t; __code test_t const Array1 = { 3, { 4, 5, } }; __code test_t const Array2 = { 6, { 7, 8, 9, 0x0A, } }; result: test.c:19: warning 147: excess elements in array initializer after 'Array2' code _Array1: DB 0x03, 0x04, 0x05 ; ; Starting pCode block for Ival _Array2: DB 0x06, 0x07, 0x08 version: SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.7.4 #4965 (Nov 16 2007) (MINGW32) cmd line: sdcc -c -mpic16 --std-sdcc99 -o"test.rel" "test.c" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1843745&group_id=599 |