bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Robert Millan
Subject: Re: [PATCH] fix build warning in fnmatch_loop.c
Date: Sun, 15 Nov 2009 11:46:09 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

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, leaving us in the same boat.  But using -Dbar=1LU made the
> warning go away.  So I'm committing this:

Thank you!

> @@ -1071,7 +1071,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, 
> const CHAR *string_end,
>                                                                             \
>           plen = (opt == L_('?') || opt == L_('@')                          \
>                   ? pattern_len                                             \
> -                 : p - startp + 1);                                        \
> +                 : p - startp + 1UL);                                      \

You don't want the assert() though?  I figured it'd be useful for extra
safety.

-- 
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."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]