tech-kern archive

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

Re: Portability fix in kern_ntptime.c



On 06.06.2019 05:07, Mouse wrote:
>> Unfortunately, if "undefined behavior" (UB) is invoked, you simply
>> cannot claim to understand what is happening, because C11-compliant
>> compilers have a lot of leeway in what code they generate when
>> behavior is undefined.
> 
> Compilers that do unexpected things under such circumstances are
> extremely poor choices for building kernels.  The kernel is not, and
> a few parts of it cannot be, fully portable code in the C, or even
> POSIX, sense.
> 
> Since IIRC the NetBSD kernel does not even try to be buildable with
> more than a few (two? three?) C implementations, I think it is entirely
> reasonable to speak of understanding the code's behaviour in many cases
> when it is, formally, undefined.
> 

That's why I proposed to paper over it and switch to defined constructs
in this case.

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index