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

Neil Hodgson <[email protected]> Tue, 30 Sep 2025 12:45:03 +1000
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <CACWkrTgtaYTUAkv24uwOUFSKphtaBZ6TeJWT5e3JZcc8zf5kCA@mail.gmail.com>
Robin Haberkorn:

> ... their storage size is equal. With this patch we no longer make such
> assumptions which should improve code portability.
>
> It also removes a hack for 32-bit Haiku which was apparently
> causing the same issues [1] I was experiencing and would probably
> be broken by now due to the same ptrdiff_t-assumptions in CellBuffer.cxx.

This produces a large number of warnings in RunStyles.cxx from MSVC
2022 17.14.122 for the x86 target.

1>G:\u\hg\scintilla\src\RunStyles.cxx(51,22): warning C4244:
'argument': conversion from 'DISTANCE' to 'ptrdiff_t', possible loss
of data
1>G:\u\hg\scintilla\src\RunStyles.cxx(51,22): warning C4244:         with
1>G:\u\hg\scintilla\src\RunStyles.cxx(51,22): warning C4244:         [
1>G:\u\hg\scintilla\src\RunStyles.cxx(51,22): warning C4244:
  DISTANCE=__int64
1>G:\u\hg\scintilla\src\RunStyles.cxx(51,22): warning C4244:         ]
1>    G:\u\hg\scintilla\src\RunStyles.cxx(51,22):
1>    the template instantiation context (the oldest one first) is
1>        G:\u\hg\scintilla\src\RunStyles.cxx(327,62):
1>        see reference to class template instantiation
'Scintilla::Internal::RunStyles<__int64,int>' being compiled
1>        G:\u\hg\scintilla\src\RunStyles.cxx(44,66):
1>        while compiling class template member function 'DISTANCE
Scintilla::Internal::RunStyles<DISTANCE,int>::SplitRun(DISTANCE)'
1>        with
1>        [
1>            DISTANCE=__int64
1>        ]

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/CACWkrTgtaYTUAkv24uwOUFSKphtaBZ6TeJWT5e3JZcc8zf5kCA%40mail.gmail.com.