[Info-vax] problem with 64-bit pointers in C

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Jan 31 08:17:48 EST 2018


On 2018-01-31, Jan-Erik Soderholm <jan-erik.soderholm at telia.com> wrote:
>
> Can one make a copy of the stddef.h and typedef ptrdiff_t to something
> else than "int"?
>

John has already addressed this, but let me be more explicit in case
someone finds this thread in the future.

This is a very, very, very bad idea indeed.

If you are lucky, the code will immediately fail in an obvious way.

If you are unlucky, the code will appear to work and then fail in
mysterious ways in the future.

Please do not do this. Ever.

Even if you got access to the compiler source code and changed the
supporting code behind the header definition, you would still be at
risk of changing other behaviour such as integer wraparound and
overflow behaviour.

As a bonus, any source code put through this modified compiler would
likely come out as object code that was no longer standards compliant.

Sorry to be so explicit about this, but I am trying to head off someone
finding this suggestion in the future and then trying it.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



More information about the Info-vax mailing list