bug-gnulib
[Top][All Lists]
Advanced

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

Re: exclude.c build failure with some sunstudio compiler


From: Paul Eggert
Subject: Re: exclude.c build failure with some sunstudio compiler
Date: Fri, 23 Sep 2005 13:27:29 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Jim Meyering <address@hidden> writes:

> On an x86_64 linux 2.6.9 system with
> CC=/usr/local/sys/sunstudio/sunstudio10u1/bin/cc
>
>   HOST=abajo.math.utah.edu
>   HOSTTYPE=x86_64-linux
>
> I see this build failure:
>
> /usr/local/sys/sunstudio/sunstudio10u1/bin/cc -DHAVE_CONFIG_H 
> -DLIBDIR=\"/usr/loc
> al/lib\" -I. -I. -I..  -I.. -I.   -g -c exclude.c
> "/usr/include/fnmatch.h", line 30: warning: macro redefined: __const
> "exclude.c", line 164: operands have incompatible types:
>          pointer to function(pointer to char, pointer to char, int) returning 
> int
>  ":" pointer to function(pointer to const char, pointer to const char, int) 
> retur
> ning int
> "exclude.c", line 164: warning: assignment type mismatch:
>         pointer to function(pointer to const char, pointer to const char, 
> int) re
> turning int "=" pointer to function(pointer to char, pointer to char, int) 
> return
> ing int
> cc: acomp failed for exclude.c
> make[3]: *** [exclude.o] Error 2
>
> Probably due to differing prototypes.
> Do you think it's worth adding a cast or two?

How about if we instead detect the implementation bug and use our own
fnmatch?  I installed this -- does it fix the problem?

2005-09-23  Paul Eggert  <address@hidden>

        * m4/fnmatch.m4 (_AC_FUNC_FNMATCH_IF): Catch Sun Studio 10u1 on Linux
        bug reported by Jim Meyering.

--- m4/fnmatch.m4       23 Jan 2005 08:06:57 -0000      1.19
+++ m4/fnmatch.m4       23 Sep 2005 20:26:33 -0000      1.21
@@ -3,7 +3,8 @@
 # This is a modified version of autoconf's AC_FUNC_FNMATCH.
 # This file should be simplified after Autoconf 2.57 is required.
 
-# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -27,9 +28,15 @@ AC_DEFUN([_AC_FUNC_FNMATCH_IF],
 #         include <fnmatch.h>
 #         define y(a, b, c) (fnmatch (a, b, c) == 0)
 #         define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
+          static int
+          fnm (char const *pattern, char const *string, int flags)
+          {
+            return fnmatch (pattern, string, flags);
+          }
          ],
         [exit
-          (!(y ("a*", "abc", 0)
+          (!((fnm ? fnm : fnmatch) ("a*", "", 0) == FNM_NOMATCH
+             && y ("a*", "abc", 0)
              && n ("d*/*1", "d/s/1", FNM_PATHNAME)
              && y ("a\\\\bc", "abc", 0)
              && n ("a\\\\bc", "abc", FNM_NOESCAPE)





reply via email to

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