From dbc215a18455517c746d70c7b53d879ded354b39 Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Mon, 31 Oct 2005 14:23:59 +0000 Subject: [PATCH] * 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 --- src/SDCCsymt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) { -- 2.30.2