tech-kern archive

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

Re: Portability fix in kern_ntptime.c



> 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.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index