GNU bug report logs - #14530
[PATCH] od: -wN, N>64K, avoid misbehavior on systems with 32-bit size_t

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 2 Jun 2013 02:42:01 UTC

Severity: normal

Tags: fixed, patch

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 14530 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: 14530 <at> debbugs.gnu.org, Rich Burridge <rich.burridge <at> oracle.com>
Subject: Re: bug#14530: [PATCH] od: -wN, N>64K, avoid misbehavior on systems
	with 32-bit size_t
Date: Sun, 02 Jun 2013 16:16:04 +0100
On 06/02/2013 03:39 AM, Jim Meyering wrote:
> Rich reported this bug privately.
> 
> Here's a proposed patch.
> I could have fixed the underlying problem with
> explicit casts to a wider type (including floating point types),
> but this seemed cleanest, if perhaps a little too subtle.
> I'd rather not write a comment in each of three places,
> and didn't really want to factor out a 3-input function
> just to compute each next_pad value.

Since this is just a local variable,
I think the proposed solution is fine.


> Along the way, I noticed that an unreasonably large width
> caused trouble, but I'm not inclined to worry about it:
> 
>   $ : | od -An -a -w$(echo 2^32-1|bc)
>   od: memory exhausted

Yes this is an artificial limit, but in such
and edge case as I don't think it's worth
complicating the code for.

+1

thanks,
Pádraig.




This bug report was last modified 6 years and 227 days ago.

Previous Next


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