From: SourceForge.net <no...@so...> - 2004-05-29 12:10:45
|
Bugs item #928906, was opened at 2004-04-03 18:50 Message generated for change (Settings changed) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=928906&group_id=599 Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Submitted By: Josef Pavlik (jetset) >Assigned to: Maarten Brock (maartenbrock) Summary: structure initialize bug Initial Comment: hello If you need to initialize an structure and you dont provide enought number of fields, the remaining fields should be initialized to 0. The SDCC does not do this. Try the following piece of code: struct xxx { unsigned char a,b,c; }; const code struct xxx foo[3]={{1,2},{4,5}}; the resulting array should be 9 bytes long and should contain the sequence 1, 2, 0, 4, 5, 0, 0, 0, 0 this is the real result: _foo: .db #0x01 .db #0x02 .db #0x04 .db #0x05 .db 0x00 .db 0x00 .db 0x00 SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.4.1 (Apr 3 2004) (UNIX) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=928906&group_id=599 |