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: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas Grünbacher <agruen <at> gnu.org>, 24311 <at> debbugs.gnu.org, peda <at> lysator.liu.se
Cc: 24311-done <at> debbugs.gnu.org
Subject: bug#24311: [bug-diffutils] bug#24311: bug#24311: bug#24311: [PATCH] maint: accommodate LP64 systems
Date: Sat, 27 Aug 2016 16:09:19 -0700
Andreas Grünbacher wrote:
> FWIW, patch has the following typedef for line numbers:
>
>   typedef off_t lin;
>
> Maybe it would be time to switch to int64_t / uint64_t and PRId64 /
> PRIu64 in diff as well as in patch?

No, as 'diff' puts all its data into memory (hence ptrdiff_t is appropriate), 
whereas 'patch' can operate on files that do not fit into memory (hence off_t is 
appropriate).

Generally speaking, portable code should be wary of using exact-sized types like 
int64_t. POSIX and the C standard don't even require int64_t, and there are a 
few (admittedly rare) implementations that lack int64_t. Even if int64_t was 
universally available, it would be better to use types like ptrdiff_t and off_t 
that reflect actual implementation limitations, as that better documents the code.




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

Previous Next


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