This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ctype: Fix bitfield types on 16-bit targets


----- Am 20. Jul 2018 um 19:37 schrieb Hans-Bernhard Bröker HBBroeker@t-online.de:

> Am 20.07.2018 um 13:07 schrieb Sebastian Huber:
>> -  unsigned int first: 24; -  unsigned short delta; +  uint_least32_t
>> first: 24; +  uint_least16_t delta;
> 
> Unfortunately that makes the code's correctness implementation-defined,
> because it now depends on what the underlying implementation's take on
> the constraint C99 6.7.2.1p4 is:
> 
>	A bit-field shall have a type that is a qualified or unqualified
>	version of _Bool, signed int, unsigned int, or some other
>	implementation-defined type.
> 
> I.e. compilers are not required to allow uint32_least_t in this place.

The previous code used short for a bit-field, so this patch makes nothing worse in this respect and fixes a real world regression on 16-bit targets.

Do you know a C99+ compiler which has a problem with such a bit-field?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]