GNU bug report logs - #24311
[PATCH] maint: accommodate LP64 systems

Previous Next

Package: diffutils;

Reported by: Peter Rosin <peda <at> lysator.liu.se>

Date: Fri, 26 Aug 2016 08:43:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>, Peter Rosin <peda <at> lysator.liu.se>, 24311 <at> debbugs.gnu.org
Subject: bug#24311: [bug-diffutils] bug#24311: bug#24311: [PATCH] maint: accommodate LP64 systems
Date: Fri, 26 Aug 2016 14:40:57 -0500
[Message part 1 (text/plain, inline)]
On 08/26/2016 01:42 PM, Paul Eggert wrote:
> On 08/26/2016 01:41 AM, Peter Rosin wrote:
>> It is wrong to assume that pointers fit in long int.
> 
> Not in GNU code.
> <https://www.gnu.org/prep/standards/html_node/CPU-Portability.html says
> that GNU programs should not make any effort to cater to the possibility
> that 'long' will be narrower than ptrdiff_t.
> 

Except that the mingw64 platform is indeed a modern platform where
pointers are 8 bytes but long is 4 bytes.  So maybe it is time to
propose a patch to the GNU Coding Standards that document the reality of
existing systems, and then start the process of auditing which programs
have been relying on the assumptions now rendered untrue by catering to
such a platform.

> Every POSIX platform is supposed to provide a compilation environment
> where 'long' is no wider than ptrdiff_t, so if you're using a POSIX
> platform you should be able to build diffutils without modifying its
> source code. See:
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html
> 

But GNU software often tries to be portable to more than just POSIX
platforms, and gnulib is already useful for catering to mingw64 where we
indeed have long narrower than intptr_t (I'm not sure off-hand whether
intptr_t and ptrdiff_t are the same size, or if ptrdiff_t is only 4 bytes).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 8 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.