Re: undefined behavior in hol_append()

2011-11-28 Thread Paul Eggert
On 11/28/11 15:39, Bruno Haible wrote: > Do you know of any platforms where sizeof (ptrdiff_t) < sizeof (void *) ? The standard operating mode for ILE C/C++ (for IBM i) has 16-byte pointers; I expect that sizeof (ptrdiff_t) is 8 and sizeof (void *) is 16 on such platforms, though I don't have a sh

Re: undefined behavior in hol_append()

2011-11-28 Thread Eric Blake
On 11/28/2011 04:39 PM, Bruno Haible wrote: > Hi Matthew, > >> e->short_options += (short_options - hol->short_options); >> >> subtracts two pointers that do not point to the same memory object. >> Something like: >> >> e->short_options = short_options + (e->short_options - hol->short_options); >>

Re: undefined behavior in hol_append()

2011-11-28 Thread Bruno Haible
Hi Matthew, > e->short_options += (short_options - hol->short_options); > > subtracts two pointers that do not point to the same memory object. > Something like: > > e->short_options = short_options + (e->short_options - hol->short_options); > > does the intended operation with legal pointer ar

Re: undefined behavior in hol_append()

2011-11-28 Thread Matthew Wala
Hi: On Mon, Nov 28, 2011 at 2:52 PM, Matthew Wala wrote: > Hello: > > The function hol_append() in lib/argp-parse.c exhibits undefined behavior. > Specifically, the expression in line 894: > Sorry, I meant lib/argp-help.c Matt

Re: [PATCH] tests: add a syntax check for last week's global change

2011-11-28 Thread Eric Blake
On 11/28/2011 12:18 PM, Jim Meyering wrote: >> That is, any objections to moving this out of coreutil's cfg.mk and into >> gnulib's maint.mk? > > I was reluctant to do that because "compare" is a pretty common word, > and I didn't try to limit the rule to a particular (tests/) directory. > If it w

undefined behavior in hol_append()

2011-11-28 Thread Matthew Wala
Hello: The function hol_append() in lib/argp-parse.c exhibits undefined behavior. Specifically, the expression in line 894: e->short_options += (short_options - hol->short_options); subtracts two pointers that do not point to the same memory object. Something like: e->short_options = short_opti

Re: [PATCH] tests: add a syntax check for last week's global change

2011-11-28 Thread Jim Meyering
Eric Blake wrote: > [adding bug-gnulib] > > On 11/27/2011 01:17 PM, Jim Meyering wrote: >> Someone should have dinged me ;-) >> Last week I made a global change but forgot to add a matching >> syntax-check rule. >> >>>From 5b3e538b7fc193f8e54b16aeb99b48f28744c1db Mon Sep 17 00:00:00 2001 >> From: J

Re: [PATCH] tests: add a syntax check for last week's global change

2011-11-28 Thread Eric Blake
[adding bug-gnulib] On 11/27/2011 01:17 PM, Jim Meyering wrote: > Someone should have dinged me ;-) > Last week I made a global change but forgot to add a matching > syntax-check rule. > >>From 5b3e538b7fc193f8e54b16aeb99b48f28744c1db Mon Sep 17 00:00:00 2001 > From: Jim Meyering > Date: Sun, 27

Re: posix_memalign

2011-11-28 Thread Eric Blake
On 11/25/2011 04:24 PM, Bruno Haible wrote: > Eric Blake wrote: If gnulib would give us posix_memalign on mingw, we could nuke this #if altogether. >>> >>> That's pretty difficult (unless you also add a posix_memalign_free) >>> because at the time posix_memalign returns you have lost the

[PATCH 1/2] propername: mark one more function as const

2011-11-28 Thread Jim Meyering
I noticed that I'd missed a function, proper_name, marked it as _GL_ATTRIBUTE_CONST, and then realized that it must not be marked with that attribute, since not only is it not "pure", but it is not "const" either. >From b6656e88f137483b7407053679870618af180de7 Mon Sep 17 00:00:00 2001 From: Jim Me

Re: RE : Re: [libvirt] [PATCH] util: fix thinko in runIO

2011-11-28 Thread Paolo Bonzini
On 11/26/2011 02:14 PM, Bastien ROUCARIES wrote: Malloc page than realloc to smaller does not work ? There is no constraint that realloc(X, N) returns X, even if N is smaller than the previous allocation size. Paolo