[tz] [PROPOSED 1/7] Avoid undefined behavior if no Link lines
Paul Eggert
eggert at cs.ucla.edu
Wed Oct 26 18:59:25 UTC 2022
On 2022-10-26 11:55, Garrett Wollman via tz wrote:
> In a perhaps less ridiculous case, undefined behavior when such a
> library function is called with a null pointer for a source argument
> allows the implementation (especially an inlining compiler) to
> pre-warm the d-cache before entering the main loop.
Unless I'm misunderstanding your example this sort of optimization
cannot be done for qsort, since the base pointer can be valid and
non-null but not dereferencable, e.g., qsort has well-defined behavior
if the pointer points one past the end of an array and nmemb is zero.
More information about the tz
mailing list