From: George M. G. <gga...@co...> - 2004-07-09 12:25:27
|
Phuah, I do not understand your problem. Three bytes should be allocated for x, one byte for y, and a warning should be issued for trying to fit 5 bytes into a three byte array. sdcc seems to be working correctly. Regards, George Phuah Yee Keat wrote: > Hi, > > Attached is the patch. > > Just a off-by-one bug, doing > xdata char x[3]={1,2,3,4,5}; > xdata char y[1]={5}; > > Still produces __xinit_x with only 4 elements. > > Cheers, > Phuah Yee Keat > >------------------------------------------------------------------------ > >--- SDCCglue.c.old 2004-07-09 16:08:58.000000000 +0800 >+++ SDCCglue.c 2004-07-09 16:09:16.000000000 +0800 >@@ -848,12 +848,11 @@ > } > > for (iloop=ilist->init.deep; iloop; iloop=iloop->next) { >- printIval (sym, type->next, iloop, oFile); >- > if ((++size > DCL_ELEM(type)) && DCL_ELEM(type)) { > werrorfl (sym->fileDef, sym->lineDef, W_EXCESS_INITIALIZERS, "array", sym->name); > break; > } >+ printIval (sym, type->next, iloop, oFile); > } > } > > > |