From: SourceForge.net <no...@so...> - 2010-12-12 04:07:55
|
Bugs item #3135551, was opened at 2010-12-11 20:07 Message generated for change (Tracker Item Submitted) made by ahessenflow You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3135551&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: C-Front End Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Allan Hessenflow (ahessenflow) Assigned to: Nobody/Anonymous (nobody) Summary: single element array initializers fail Initial Comment: sdcc version: SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.9.0 #5416 (Dec 11 2010) (UNIX) test code: char test1[] = {3}; char test2[1] = {1 + 2}; char test3[] = {1 + 2, 1 + 2}; char test4[] = {1 + 2}; command line: sdcc -c test.c output: test.c:4: error 2: Initializer element is not constant The initializer for test4[] is constant but sdcc says it isn't. The arrays test1, test2, and test3 show that modifying just about anything - explicitly setting the array size, adding a second element, or eliminating the integer operator works. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3135551&group_id=599 |