From: SourceForge.net <no...@so...> - 2004-05-31 16:31:28
|
Bugs item #770487, was opened at 2003-07-13 13:14 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=770487&group_id=599 Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Submitted By: Scott Bronson (bronson) Assigned to: Maarten Brock (maartenbrock) Summary: Crash when compiling struct w/array initializers Initial Comment: The following code dies with a SIGSEGV: typedef struct { unsigned char length; unsigned char unicode_data[]; } StringDescriptor; const idata StringDescriptor StringDscr0 = { sizeof(StringDscr0), { 0x09, // English 0x04 // U.S. English } }; const idata StringDescriptor StringDscr1 = { sizeof(StringDscr1), { 'C', 0, 'y', 0 } }; bronson@vesper:/tmp$ sdcc -c d.c Caught signal 11: SIGSEGV That's as small as I was able to get the code and still have it bus error every time. ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2004-05-31 18:31 Message: Logged In: YES user_id=888171 SIGSEGV is fixed in SDCCast.c 1.238 What remains is that after the first initialized instance the type gets updated with the first allocation size. If the second instance is larger, SDCC still complains about excess initializers. A workaround is to keep the largest instance as the first one or keep all instances in different source files. Maarten ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=770487&group_id=599 |