[PATCH] Check for strtol, strtoul, strtoll and strtoull declarations

2014-11-22 Thread John David Anglin

This patch fixes PR other/63694.

Libiberty now contains implementations for strtol, strtoul, strtoll  
and strtoull.  On systems which
lack one or more of these functions, we need to check for their  
declaration in configure.  This results
in the correct defines being generated in config.h and auto-host.h.   
Then, the declarations for

these functions in libiberty.h are appropriated enabled.

Tested on hppa2.0w-hp-hpux11.11.

OK for trunk.

Dave
--
John David Anglin   dave.ang...@bell.net


libiberty ChangeLog:
2014-11-22  John David Anglin  dang...@gcc.gnu.org

PR other/63694
* configure.ac: Check for strtol, strtoul, strtoll and strtoull
declarations.
* configure: Regenerated.

gcc ChangeLog:
2014-11-22  John David Anglin  dang...@gcc.gnu.org

PR other/63694
* configure.ac: Check for strtol, strtoul, strtoll and strtoull
declarations.
* configure: Regenerated.
* config.in: Regenerated.

Index: libiberty/configure.ac
===
--- libiberty/configure.ac  (revision 217956)
+++ libiberty/configure.ac  (working copy)
@@ -678,6 +678,7 @@
   AC_CHECK_FUNCS($checkfuncs)
   AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, 
vsnprintf])
   AC_CHECK_DECLS([calloc, getenv, getopt, malloc, realloc, sbrk])
+  AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoull])
   AC_CHECK_DECLS([strverscmp])
   libiberty_NEED_DECLARATION(canonicalize_file_name)
 fi
Index: gcc/configure.ac
===
--- gcc/configure.ac(revision 217956)
+++ gcc/configure.ac(working copy)
@@ -1213,6 +1213,7 @@
 CXXFLAGS=$CXXFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC
 gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
stpcpy strnlen strsignal strstr strverscmp \
+   strtol strtoul strtoll strtoull \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
free basename getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[
 #include ansidecl.h


Re: [PATCH] Check for strtol, strtoul, strtoll and strtoull declarations

2014-11-22 Thread Jakub Jelinek
On Sat, Nov 22, 2014 at 09:40:58AM -0500, John David Anglin wrote:
 libiberty ChangeLog:
 2014-11-22  John David Anglin  dang...@gcc.gnu.org
 
   PR other/63694
   * configure.ac: Check for strtol, strtoul, strtoll and strtoull
   declarations.
   * configure: Regenerated.
 
 gcc ChangeLog:
 2014-11-22  John David Anglin  dang...@gcc.gnu.org
 
   PR other/63694
   * configure.ac: Check for strtol, strtoul, strtoll and strtoull
   declarations.
   * configure: Regenerated.
   * config.in: Regenerated.

Looks reasonable to me, but I'll defer it to Ian as libiberty maintainer.

 Index: libiberty/configure.ac
 ===
 --- libiberty/configure.ac(revision 217956)
 +++ libiberty/configure.ac(working copy)
 @@ -678,6 +678,7 @@
AC_CHECK_FUNCS($checkfuncs)
AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, 
 vsnprintf])
AC_CHECK_DECLS([calloc, getenv, getopt, malloc, realloc, sbrk])
 +  AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoull])
AC_CHECK_DECLS([strverscmp])
libiberty_NEED_DECLARATION(canonicalize_file_name)
  fi
 Index: gcc/configure.ac
 ===
 --- gcc/configure.ac  (revision 217956)
 +++ gcc/configure.ac  (working copy)
 @@ -1213,6 +1213,7 @@
  CXXFLAGS=$CXXFLAGS -I${srcdir} -I${srcdir}/../include $GMPINC
  gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \
   stpcpy strnlen strsignal strstr strverscmp \
 + strtol strtoul strtoll strtoull \
   errno snprintf vsnprintf vasprintf malloc realloc calloc \
   free basename getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[
  #include ansidecl.h


Jakub


Re: [PATCH] Check for strtol, strtoul, strtoll and strtoull declarations

2014-11-22 Thread John David Anglin

On 22-Nov-14, at 9:50 AM, Jakub Jelinek wrote:


On Sat, Nov 22, 2014 at 09:40:58AM -0500, John David Anglin wrote:

libiberty ChangeLog:
2014-11-22  John David Anglin  dang...@gcc.gnu.org

PR other/63694
* configure.ac: Check for strtol, strtoul, strtoll and strtoull
declarations.
* configure: Regenerated.


I should have mentioned that config.in in libiberty doesn't need to be  
regenerated.


Dave
--
John David Anglin   dave.ang...@bell.net





Re: [PATCH] Check for strtol, strtoul, strtoll and strtoull declarations

2014-11-22 Thread Ian Lance Taylor
Jakub Jelinek ja...@redhat.com writes:

 On Sat, Nov 22, 2014 at 09:40:58AM -0500, John David Anglin wrote:
 libiberty ChangeLog:
 2014-11-22  John David Anglin  dang...@gcc.gnu.org
 
  PR other/63694
  * configure.ac: Check for strtol, strtoul, strtoll and strtoull
  declarations.
  * configure: Regenerated.
 
 gcc ChangeLog:
 2014-11-22  John David Anglin  dang...@gcc.gnu.org
 
  PR other/63694
  * configure.ac: Check for strtol, strtoul, strtoll and strtoull
  declarations.
  * configure: Regenerated.
  * config.in: Regenerated.

 Looks reasonable to me, but I'll defer it to Ian as libiberty maintainer.

This is OK.

Thanks.

Ian