Eric Blake wrote: > Another candidate for fixing: > > g++ -I. -g -O2 -MT strcasecmp.o -MD -MP -MF .deps/strcasecmp.Tpo -c -o > strcasecmp.o strcasecmp.c > In file included from mbchar.h:149, > from mbuiter.h:101, > from strcasecmp.c:29: > /usr/include/string.h:326: error: declaration of `int rpl_strcasecmp(const > char*, const char*) throw ()' throws different exceptions > strcase.h:34: error: than previous declaration `int rpl_strcasecmp(const > char*, > const char*)'
I'm applying this patch: 2006-11-01 Bruno Haible <[EMAIL PROTECTED]> * m4/strcase.m4 (gl_FUNC_STRCASECMP): Don't define strcasecmp here. * lib/strcase.h: Include <string.h>. (strcasecmp): Define to rpl_strcasecmp here. diff -c -3 -r1.4 strcase.m4 *** m4/strcase.m4 26 Sep 2005 13:58:51 -0000 1.4 --- m4/strcase.m4 1 Nov 2006 20:40:31 -0000 *************** *** 1,5 **** ! # strcase.m4 serial 3 ! dnl Copyright (C) 2002, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. --- 1,5 ---- ! # strcase.m4 serial 4 ! dnl Copyright (C) 2002, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. *************** *** 15,21 **** dnl No known system has a strcasecmp() function that works correctly in dnl multibyte locales. Therefore we use our version always. AC_LIBOBJ(strcasecmp) - AC_DEFINE(strcasecmp, rpl_strcasecmp, [Define to rpl_strcasecmp always.]) gl_PREREQ_STRCASECMP ]) --- 15,20 ---- diff -c -3 -r1.5 strcase.h *** lib/strcase.h 16 Aug 2005 12:21:21 -0000 1.5 --- lib/strcase.h 1 Nov 2006 20:40:31 -0000 *************** *** 1,5 **** /* Case-insensitive string comparison functions. ! Copyright (C) 1995-1996, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /* Case-insensitive string comparison functions. ! Copyright (C) 1995-1996, 2001, 2003, 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 19,31 **** #define _STRCASE_H #include <stddef.h> ! #ifdef __cplusplus extern "C" { #endif /* Compare strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. --- 19,37 ---- #define _STRCASE_H #include <stddef.h> ! /* Include header files with a possibly conflicting declarations of strcasecmp ! before we define it as a macro, so that they will be no-ops if included ! after strcasecmp is defined as a macro. */ ! #include <string.h> #ifdef __cplusplus extern "C" { #endif + /* No known system has a strcasecmp() function that works correctly in + multibyte locales. Therefore we use our version always. */ + #define strcasecmp rpl_strcasecmp /* Compare strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. > /usr/include/string.h:330: error: declaration of `int strncasecmp(const > char*, > const char*, size_t) throw ()' throws different exceptions > strcase.h:40: error: than previous declaration `int strncasecmp(const char*, > const char*, size_t)' And this one: 2006-11-01 Bruno Haible <[EMAIL PROTECTED]> * m4/strcase.m4 (gl_FUNC_STRNCASECMP): Check whether strncasecmp is already declared in <string.h>. * lib/strcase.h (strncasecmp): Don't declare it if yes. diff -c -3 -r1.5 strcase.m4 *** m4/strcase.m4 1 Nov 2006 20:42:35 -0000 1.5 --- m4/strcase.m4 1 Nov 2006 20:47:37 -0000 *************** *** 21,26 **** --- 21,27 ---- AC_DEFUN([gl_FUNC_STRNCASECMP], [ AC_REPLACE_FUNCS(strncasecmp) + AC_CHECK_DECLS(strncasecmp) if test $ac_cv_func_strncasecmp = no; then gl_PREREQ_STRNCASECMP fi diff -c -3 -r1.6 strcase.h *** lib/strcase.h 1 Nov 2006 20:42:35 -0000 1.6 --- lib/strcase.h 1 Nov 2006 20:47:37 -0000 *************** *** 43,49 **** --- 43,51 ---- returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. Note: This function can not work correctly in multibyte locales. */ + #if ! HAVE_DECL_STRNCASECMP extern int strncasecmp (const char *s1, const char *s2, size_t n); + #endif #ifdef __cplusplus