[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in coreutils-4.5.9 "df" under AIX 5.1 -- found and fixed
From: |
Jim Meyering |
Subject: |
Re: Bug in coreutils-4.5.9 "df" under AIX 5.1 -- found and fixed |
Date: |
Tue, 18 Mar 2003 16:06:07 +0100 |
Mike Jetzer <address@hidden> wrote:
...
> When compiling under HP-UX B.11.11 (using the ANSI c
> compiler -- I can't determine its version using "-v" or
> "-V"; the exact command line is "cc -Aa +DAportable
> -D_HPUX_SOURCE", which is what we typically use for GNU
> packages), the following error is returned
> cc: "exclude.c", line 177: error 1552: Incompatible
> types in second and third operands of conditional
> expression (?:).
>
> This appears to be because the fnmatch() prototype in
> libfnmatch.h is getting its __const keywords replaced with
> the empty string, and thus does not match
> fnmatch_no_wildcards() (even if __const were replaced with
> "const", I don't know if the compiler would have complained
> because fnmatch() takes two "const char *" arguments, while
> fnmatch_no_wildcards() takes two "char const *". To get
> around this, I simply removed the "const" qualifiers from
> fnmatch_no_wildcards().
Thanks for the detailed report!
Here's one way to work around the HP-UX problem:
Index: exclude.c
===================================================================
RCS file: /fetish/cu/lib/exclude.c,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 exclude.c
--- exclude.c 6 Jan 2003 13:17:48 -0000 1.11
+++ exclude.c 18 Mar 2003 14:58:26 -0000
@@ -173,9 +173,11 @@ excluded_filename (struct exclude const
int options = exclude[i].options;
if (excluded == !! (options & EXCLUDE_INCLUDE))
{
- int (*matcher) PARAMS ((char const *, char const *, int)) =
+ typedef int (*fnmatch_t)
+ PARAMS ((char const *, char const *, int));
+ fnmatch_t matcher =
(options & EXCLUDE_WILDCARDS
- ? fnmatch
+ ? (fnmatch_t) fnmatch
: fnmatch_no_wildcards);
bool matched = ((*matcher) (pattern, f, options) == 0);
char const *p;