GNU bug report logs -
#9157
[PATCH] dd: sparse conv flag
Previous Next
Reported by: Roman Rybalko <devel <at> romanr.info>
Date: Sat, 23 Jul 2011 22:42:04 UTC
Severity: normal
Tags: patch
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
Message #64 received at 9157 <at> debbugs.gnu.org (full text, mbox):
On 02/28/2012 03:13 PM, Jim Meyering wrote:
>> -#define OUTPUT_BLOCK_SLOP (page_size - 1)
>> > +#define OUTPUT_BLOCK_SLOP MAX (sizeof (uintptr_t), page_size - 1)
> I haven't seen justification for why you're making the above change.
> Can sizeof uintptr_t really be larger than page_size-1 (getpagesize()-1)?
> This seems so unlikely that it'd deserve an assertion in main where
> page_size is set, even though there are only two uses of OUTPUT_BLOCK_SLOP.
Theoretically getpagesize could return 1, no?
Admittedly it's unlikely. I guess it'd be OK
to omit this change, and to just put in a comment
saying something like "We use the output slop
to store a uintptr_t value, so we assume that
getpagesize returns a value greater than sizeof (uintptr_t)."
Perhaps the comment should go right next to the place where
the uintptr_t sentinel is inserted.
> If you leave the sizeof, please omit the parentheses.
But "sizeof uintptr_t" wouldn't work, as uintptr_t is a type.
This bug report was last modified 13 years and 182 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.