From: bernhardheld Date: Mon, 31 Oct 2005 14:23:59 +0000 (+0000) Subject: * src/SDCCsymt.c (compStructSize): make bitfields without (un)signed specifier unsigned X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=dbc215a18455517c746d70c7b53d879ded354b39;p=fw%2Fsdcc * src/SDCCsymt.c (compStructSize): make bitfields without (un)signed specifier unsigned git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3925 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 0031f20b..ab7cede1 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1233,11 +1233,11 @@ compStructSize (int su, structdef * sdef) /* change it to a unsigned bit */ SPEC_NOUN (loop->etype) = V_BITFIELD; - if (TARGET_IS_PIC16 || TARGET_IS_PIC) { - /* PIC users requested signed bitfields as well */ - } else { - SPEC_USIGN (loop->etype) = 1; - } + /* ISO/IEC 9899 J.3.9 implementation defined behaviour: */ + /* a "plain" int bitfield is unsigned */ + if (!loop->etype->select.s.b_signed) + SPEC_USIGN(loop->etype) = 1; + SPEC_BLEN (loop->etype) = loop->bitVar; if (loop->bitVar == BITVAR_PAD) {