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: Peter Rosin <peda <at> lysator.liu.se>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 24311-done <at> debbugs.gnu.org
Subject: bug#24311: [bug-diffutils] bug#24311: bug#24311: [PATCH] maint: accommodate LP64 systems
Date: Sun, 28 Aug 2016 22:03:30 +0200
On 2016-08-28 00:07, Paul Eggert wrote:
> On further thought, I came up with a patch that should be portable without 
> overly complicating the code or hurting efficiency, so I installed it 
> (attached). Please give it a try on your platform.

So, I didn't expect that to work, because the C library in question is the
system msvcrt, which is compatible with the msvcrt for MSVC 6.0. That msvcrt
was released almost 30 years ago. I have a strong suspicion that all system
versions of the msvcrt library out there do not support %lld, even if you
limit the search to 64-bit Windows...

All in all, I was a bit surprised when it actually did work, and started
digging.

It seems that mingw-w64 includes overrides for the *printf functions, probably
because they are so unportable in msvcrt. Anyway, the overrides includes support
for the t length modifier, so a better patch might be a configure check to see
if %td works, with machinery to set printint/pI to ptrdiff_t/"t" if it does and
fall back to long int/"l" if it doesn't.

That would be correct even for weird -- but standards conformant -- systems
where even long long is too small for some obscure reason.

> I am still leery about changing the GNU coding standards, though. In general we 
> shouldn't ask developers to jump through these sorts of hoops for platforms so 
> far from the typical GNU environment.

My main beef with the GCS on this issue is that it suggests that maintainers
should not spend any time at all on this issue, as if that would be contrary
to some other goal. It would be much more palatable if it stated that
maintainers did not need to spend time on the issue if they didn't want to.

Cheers,
Peter




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

Previous Next


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