This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch libstdc++]: Fix LLP64 pointer-size issues for cxxabi, eh_alloc, and hash_bytes

On Fri, Dec 21, 2012 at 3:48 AM, Kai Tietz <> wrote:
> 2012/12/21 Paolo Carlini <>:
>> On 12/21/2012 10:36 AM, Kai Tietz wrote:
>>> well, issue isn't that 'long' is always 'ptrdiff_t'.
>> But then, if we just change the type without paying attention to size (and
>> alignment) aren't we looking for BIG ABI trouble?!?
> Huh?  We have ABI-trouble due long is  too small to hold a
> pointer-diff for llp64.  Intended is here 'pointer-size' AFAICS in
> code, but with wrong assumption that a 'long' is always long enough.
>  Btw I just checked all targets we have right now in gcc.  The type
> ptrdiff_t is always either 'long', or 'int' (ilp32, lp64), and 'long
> long' for LLP64.  Means ptrdiff_t gets always equal (or bigger) to
> biggest pointer-size for target (AFAICS).
> Kai

We must write the codes so that their intents are clear, without
requiring lot of reverse engineering every time one looks at them.  If we
intend offset, then clearly ptrdiff_t is the first choice.  Solid
reasons must be provided why it can't be ptrdiff_t and such
reasons must be part of the code as comments explaining why
the obvious thing should be discounted.

- Gaby

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]