Mercurial > hg > octave-nkf > gnulib-hg
diff lib/fnmatch_loop.c @ 12293:9eca5d75491d
fnmatch: avoid compiler warning
cond ? (size_t) : (char* - char* + 1) varies in signedness, but
using 1LU coerces the latter half to unsigned math.
* lib/fnmatch_loop.c (NEW_PATTERN): Coerce addition to unsigned,
to silence compiler warning about mismatch signedness in ?:.
Reported by Robert Millan.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Sat, 14 Nov 2009 15:25:49 -0700 |
parents | c9127d50c750 |
children | e8d2c6fc33ad |
line wrap: on
line diff
--- a/lib/fnmatch_loop.c +++ b/lib/fnmatch_loop.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006 +/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -1071,7 +1071,7 @@ \ plen = (opt == L_('?') || opt == L_('@') \ ? pattern_len \ - : p - startp + 1); \ + : p - startp + 1UL); \ plensize = plen * sizeof (CHAR); \ newpsize = offsetof (struct patternlist, str) + plensize; \ if ((size_t) -1 / sizeof (CHAR) < plen \