* src/SDCCsymt.c (compStructSize): make bitfields without (un)signed specifier unsigned
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 31 Oct 2005 14:23:59 +0000 (14:23 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 31 Oct 2005 14:23:59 +0000 (14:23 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3925 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCsymt.c

index 0031f20b38944b125096ea7648427d591735e17f..ab7cede1fa67f27a8dd3a8c248ec383ef66977fe 100644 (file)
@@ -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) {