[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strtoimax: work around AIX 5.1 bug
From: |
Pádraig Brady |
Subject: |
Re: strtoimax: work around AIX 5.1 bug |
Date: |
Thu, 05 Jan 2012 18:14:59 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 |
On 01/05/2012 05:50 PM, Bruno Haible wrote:
> *** m4/strtoimax.m4.orig Thu Jan 5 18:46:08 2012
> --- m4/strtoimax.m4 Thu Jan 5 18:45:21 2012
> ***************
> *** 1,4 ****
> ! # strtoimax.m4 serial 11
> dnl Copyright (C) 2002-2004, 2006, 2009-2012 Free Software Foundation, Inc.
> dnl This file is free software; the Free Software Foundation
> dnl gives unlimited permission to copy and/or distribute it,
> --- 1,4 ----
> ! # strtoimax.m4 serial 12
> dnl Copyright (C) 2002-2004, 2006, 2009-2012 Free Software Foundation, Inc.
> dnl This file is free software; the Free Software Foundation
> dnl gives unlimited permission to copy and/or distribute it,
> ***************
> *** 14,19 ****
> --- 14,71 ----
> if test "$ac_cv_have_decl_strtoimax" != yes; then
> HAVE_DECL_STRTOIMAX=0
> fi
> +
> + if test $ac_cv_func_strtoimax = yes; then
> + HAVE_STRTOIMAX=1
> + dnl On AIX 5.1, strtoimax() fails for values outside the 'int' range.
> + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
> + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
> + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
> + AC_CACHE_CHECK([whether strtoimax works], [gl_cv_func_strtoimax],
> + [AC_RUN_IFELSE(
> + [AC_LANG_SOURCE([[
> + #include <errno.h>
> + #include <stdio.h>
> + #include <string.h>
> + #include <sys/types.h>
> + #if HAVE_STDINT_H_WITH_UINTMAX
> + # include <stdint.h>
> + #endif
> + #if HAVE_INTTYPES_H_WITH_UINTMAX
> + # include <inttypes.h>
> + #endif
> + int main ()
> + {
> + const char *s = "4294967295";
Should that string be defined based on sizeof(intmax_t)?
cheers,
Pádraig.