package: check
severity: normal

The AM_PATH_CHECK macro in 0.9.3 fails to build if -Werror -g -O2 is
used as the CFLAGS during autoconf:

configure:22065: i486-linux-gnu-gcc -o conftest -Werror -g -O2
conftest.c -lcheck  >&5
cc1: warnings being treated as errors
conftest.c: In function 'main':
conftest.c:41: warning: incompatible implicit declaration of built-in
function 'strdup'
configure:22068: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "OpenSync"
| #define PACKAGE_TARNAME "libopensync"
| #define PACKAGE_VERSION "0.18"
| #define PACKAGE_STRING "OpenSync 0.18"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "libopensync"
| #define VERSION "0.18"
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using std::exit;
| #endif
| #define BUILD_ENGINE 1
| #define ENABLE_DEBUG 1
| #define ENABLE_TRACE 1
| /* end confdefs.h.  */
|
| #include <stdio.h>
| #include <stdlib.h>
|
| #include <check.h>
|
| int main ()
| {
|   int major, minor, micro;
|   char *tmp_version;
|
| 
|   system ("touch conf.check-test");
| 
|   /* HP/UX 9 ([EMAIL PROTECTED]) writes to sscanf strings */
|   tmp_version = strdup("0.9.0");
|   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
|      printf("%s, bad version string\n", "0.9.0");
|      return 1;
|    }
| 
|   if ((CHECK_MAJOR_VERSION != check_major_version) ||
|       (CHECK_MINOR_VERSION != check_minor_version) ||
|       (CHECK_MICRO_VERSION != check_micro_version))
|     { 
|       printf("\n*** The check header file (version %d.%d.%d) does not
match\n",
|            CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION,
CHECK_MICRO_VERSION);
|       printf("*** the check library (version %d.%d.%d).\n",
|            check_major_version, check_minor_version,
check_micro_version);
|       return 1;
|     } 
|   
|   if ((check_major_version > major) ||
...
configure:22095: result: no
configure:22124: i486-linux-gnu-gcc -o conftest -Werror -g -O2
conftest.c -lcheck  >&5


Note that all that is needed is to add

#if HAVE_STRING_H
#include <string.h>
#endif

and it should work fine.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to