From 0c4be75eb0966bde4533bc111778e0ab494a93be Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 18 May 2011 13:13:03 -0600 Subject: [PATCH] fnmatch: avoid compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Detected on Ubuntu 10.04, where the glibc fnmatch fix is not yet present; also reproduced via: $ gl_cv_func_fnmatch_posix=no CFLAGS=-Wall \ ./gnulib-tool --with-tests --test fnmatch In file included from gllib/fnmatch.c:172:0: gllib/fnmatch_loop.c: In function ‘internal_fnmatch’: gllib/fnmatch_loop.c:203:28: error: initialization discards qualifiers from pointer target type gllib/fnmatch_loop.c:204:28: error: initialization discards qualifiers from pointer target type * lib/fnmatch_loop.c (FCT): Use correct type. Reported by Matthias Bolte. Signed-off-by: Eric Blake --- ChangeLog | 6 ++++++ lib/fnmatch_loop.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffea4737db..99e2c3e702 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-05-18 Eric Blake + + fnmatch: avoid compiler warning + * lib/fnmatch_loop.c (FCT): Use correct type. + Reported by Matthias Bolte. + 2011-05-13 Jim Meyering maint.mk: three new prohibit__without_use rules diff --git a/lib/fnmatch_loop.c b/lib/fnmatch_loop.c index 1fb246f0a2..8334491d40 100644 --- a/lib/fnmatch_loop.c +++ b/lib/fnmatch_loop.c @@ -200,8 +200,8 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, case L_('['): { /* Nonzero if the sense of the character class is inverted. */ - CHAR *p_init = p; - CHAR *n_init = n; + const CHAR *p_init = p; + const CHAR *n_init = n; register bool not; CHAR cold; UCHAR fn; -- 2.30.2