[tz] [PROPOSED 1/7] Avoid undefined behavior if no Link lines

Clive D.W. Feather clive at davros.org
Wed Oct 26 16:17:16 UTC 2022


Paul Eggert via tz said:
> Presumably this is because the GCC 
> maintainers are in the faction that says a null pointer cannot be used 
> to pass a size-zero object to a library function. This is likely the 
> same faction that says "char *p = NULL; return p + 0;" has undefined 
> behavior.

I agree with them in both cases. There are no zero-sized objects in C.

(This is C90 and C99; I dropped off WG14 in the early noughties.)

-- 
Clive D.W. Feather          | If you lie to the compiler,
Email: clive at davros.org     | it will get its revenge.
Web: http://www.davros.org  |   - Henry Spencer
Mobile: +44 7973 377646


More information about the tz mailing list