From: SourceForge.net <no...@so...> - 2011-09-15 21:44:47
|
Bugs item #3135551, was opened at 2010-12-12 05:07 Message generated for change (Comment added) made by maartenbrock 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: fixed >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Allan Hessenflow (ahessenflow) >Assigned to: Maarten Brock (maartenbrock) 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. ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2011-09-15 23:44 Message: Fixed in SDCC 3.0.4 #6854. ---------------------------------------------------------------------- Comment By: Allan Hessenflow (ahessenflow) Date: 2010-12-12 06:12 Message: I've retested with the recent snapshot: SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.1 #6079 (Dec 11 2010) (Linux) The results are the same. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3135551&group_id=599 |