Re: [PATCH] support ptrdiff_t if it has the same storage size as int, but does not alias it

Neil Hodgson <[email protected]> Mon, 13 Oct 2025 11:50:03 +1100
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <CACWkrThFuD+iq-q=s2ruYfn1FgK4m25vPdN9keoR6atCUrUvEA@mail.gmail.com>
Robin Haberkorn:

> ... on NetBSD where
> apparently some ports use long and others int.

If a platform isn't interested in consistency then it will lose in the
market. It is unreasonable to expect other projects to adapt to this.

> Also, do we really know that on Haiku? They support armv7 as well.

That will be up to the Haiku people.

> Am I supposed to write some kind of custom Autoconf compile test to check
> for the aliasability of ptrdiff_t with int if sizeof(ptrdiff_t) == sizeof(int)
> and pass in -D__HAIKU__ on all platforms that do?

That's one approach. You could loop over the options in a shell build
script and drop out on success.

> Then we should at the very least give it a more
> neutral name like RUNSTYLES_NEEDS_PTRDIFF or something.

A generically named check can be added if done in a way that preserves Haiku.

I suspect that it is possible to templatize the instantiations over
is_convertible_v, possibly using enable_if, replacing the #if but that
needs someone more motivated than me.

Neil

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/CACWkrThFuD%2Biq-q%3Ds2ruYfn1FgK4m25vPdN9keoR6atCUrUvEA%40mail.gmail.com.