Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/sys



On 07.11.2018 00:55, maya%netbsd.org@localhost wrote:
> On Tue, Nov 06, 2018 at 11:15:11PM +0300, Valery Ushakov wrote:
>> On Tue, Nov 06, 2018 at 16:26:44 +0000, Maya Rashish wrote:
>>
>>> Module Name:	src
>>> Committed By:	maya
>>> Date:		Tue Nov  6 16:26:44 UTC 2018
>>>
>>> Modified Files:
>>> 	src/sys/sys: stdint.h types.h
>>>
>>> Log Message:
>>> Guard from type redefinition (needed by pre-C11 C) in a safer way.
>>>
>>> The existing way causes problems like:
>>> https://mail-index.netbsd.org/tech-pkg/2018/10/25/msg020395.html
>>> https://mail-index.netbsd.org/tech-userlevel/2018/09/08/msg011381.html
>>
>> I would argue that the first example is, if not outright wrong, then
>> at the very minimum unhygienic, as it doesn't use the same
>> preprocessor nesting for the definition of the name and the use of the
>> name, i.e. it incorrectly assumes that the function will be named
>> "something_uint32_t".
>>
>> Also your change breaks redefining intN_t types with the preprocessor.
>> E.g.
>>
>>     #define uint32_t unsigned long long
>>     #include <stdint.h>
>>
>> is now broken with your change.
>>
>> -uwe
> 
> This fails with glibc too. I don't expect to find real users for that
> behaviour...
> 

intN_t is C99, C++11, POSIX/UNIX standard

Our previous behavior was barely compliant and not understood by some of
toolchain developers (it was discussed by LLVM developers just few days
ago) and they prompted me/us to switch it.

Some of new UBSan tests broke only on NetBSD because we were the only
tested OS that mangled the intN_t names and we had to deteriorate the
tests because of unrolling intN_t types to anything.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index