X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCsymt.c;h=a27c0ec60c9f80a5486768c1f2b253fbbb6ec088;hb=122a98623b6e7e3811469a36163421079652966a;hp=94ad4d70705893e2e8879f845a49f35395165c9f;hpb=13b845db7aab0716af2fa014cbfcaa56dc4b0a73;p=fw%2Fsdcc diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 94ad4d70..a27c0ec6 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1280,16 +1280,17 @@ compStructSize (int su, structdef * sdef) if (!loop->etype->select.s.b_signed) SPEC_USIGN(loop->etype) = 1; - SPEC_BLEN (loop->etype) = loop->bitVar; - if (loop->bitVar == BITVAR_PAD) { /* A zero length bitfield forces padding */ - SPEC_BSTR (loop->etype) = bitOffset; SPEC_BLEN (loop->etype) = 0; - bitOffset = 8; + SPEC_BSTR (loop->etype) = bitOffset; + if (bitOffset > 0) + bitOffset = 8; /* padding is not needed when at bit 0 */ loop->offset = sum; } else { + SPEC_BLEN (loop->etype) = loop->bitVar; + if (bitOffset == 8) { bitOffset = 0; sum++;