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

Clive D.W. Feather clive at davros.org
Fri Oct 28 11:00:52 UTC 2022


Paul Eggert said:
> So I am 
> unaware of any platform where (char *)0 + 0 does not give you a null 
> pointer.
> 
> If I'm right, the C standard's prohibition of (char *)0 + 0 is 
> unnecessarily restrictive, as it prohibits programs that are portable in 
> practice.

The problem is that "I am unaware of any" is not the same as "there is no".

A lot of people don't believe me when I say that there is a processor where
CHAR_BIT is 16 and sizeof(int) is 1. Yet for many years it was the third
most common processor in the world.

I'm no longer involved in WG14 and haven't been for many years. You'd have
to raise it with them.

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