Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Robert Millan on 11/15/2009 3:46 AM: > > You don't want the assert() though? I figured it'd be useful for extra > safety. Safety from what? The code has been quite well-tested, belongs to a static method, and both p and startp are loca

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-15 Thread Robert Millan
On Sat, Nov 14, 2009 at 03:41:59PM -0700, Eric Blake wrote: > > Oh, I see. I repeated the experiment on a 64-bit machine, and got the > same error even with -Dbar=1U. It comes because (p - startp) is a 64-bit > ptrdiff_t, but 1U is only 32-bit, so it promotes to long rather than > unsigned long,

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Robert Millan on 11/14/2009 8:30 AM: : p - startp + 1U; to still show that we intend for unsigned math, but without a cast? >>> The warning persists. >> Can you show the exact gcc version, command line options, and warning >

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-14 Thread Robert Millan
On Sat, Nov 14, 2009 at 07:41:24AM -0700, Eric Blake wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > According to Robert Millan on 11/9/2009 2:50 PM: > >> I'm not a fan of unnecessary casts. Can't we instead write this as: > >> > >> : p - startp + 1U; > >> > >> to still show that we

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Robert Millan on 11/9/2009 2:50 PM: >> I'm not a fan of unnecessary casts. Can't we instead write this as: >> >> : p - startp + 1U; >> >> to still show that we intend for unsigned math, but without a cast? > > The warning persists. Can

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-09 Thread Robert Millan
Btw, excuse me for the duplicate mail. It's a bit odd, but I don't receive any mail from the list (my server doesn't register attempts from mailman), even though I'm subscribed (if I try to re-subscribe, I do receive a notification). Perhaps someone could investigate this? -- Robert Millan

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-09 Thread Robert Millan
> I'm not a fan of unnecessary casts. Can't we instead write this as: > > : p - startp + 1U; > > to still show that we intend for unsigned math, but without a cast? The warning persists. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you

[PATCH] fix build warning in fnmatch_loop.c

2009-11-09 Thread Robert Millan
Fixes a build warning in fnmatch_loop.c. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." gnulib/fnmatch_loop

Re: [PATCH] fix build warning in fnmatch_loop.c

2009-11-09 Thread Eric Blake
Robert Millan aybabtu.com> writes: > Fixes a build warning in fnmatch_loop.c. > > > -: p - startp + 1); \ > +: (unsigned) (p - startp) + 1); \ I'm not a fan of unnecessary casts. Can't we instead write this as: : p - startp + 1U; to still show that we intend for unsigned

[PATCH] fix build warning in fnmatch_loop.c

2009-11-09 Thread Robert Millan
Fixes a build warning in fnmatch_loop.c. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." gnulib/fnmatch_loop