public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
Subject: Re: MinGW compilation warnings in libiberty's xstrndup.c
Date: Fri, 26 May 2017 21:49:00 -0000	[thread overview]
Message-ID: <xnwp93e20b.fsf@greed.delorie.com> (raw)
In-Reply-To: <83h90vcqo6.fsf@gnu.org> (message from Eli Zaretskii on Mon, 08 May 2017 18:30:01 +0300)


Please try this patch:

Index: config.in
===================================================================
--- config.in	(revision 248482)
+++ config.in	(working copy)
@@ -76,12 +76,16 @@
 #undef HAVE_DECL_SBRK
 
 /* Define to 1 if you have the declaration of `snprintf', and to 0 if you
    don't. */
 #undef HAVE_DECL_SNPRINTF
 
+/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
+   don't. */
+#undef HAVE_DECL_STRNLEN
+
 /* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRTOL
 
 /* Define to 1 if you have the declaration of `strtoll', and to 0 if you
    don't. */
Index: configure
===================================================================
--- configure	(revision 248482)
+++ configure	(working copy)
@@ -5861,12 +5861,22 @@ else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_STRTOULL $ac_have_decl
 _ACEOF
+ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strnlen" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNLEN $ac_have_decl
+_ACEOF
 
 
 $as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h
 
 
 $as_echo "#define HAVE_SYS_NERR 1" >>confdefs.h
@@ -7002,12 +7012,23 @@ else
 fi
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL_STRVERSCMP $ac_have_decl
 _ACEOF
 
+  ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strnlen" = x""yes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRNLEN $ac_have_decl
+_ACEOF
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether canonicalize_file_name must be declared" >&5
 $as_echo_n "checking whether canonicalize_file_name must be declared... " >&6; }
 if test "${libiberty_cv_decl_needed_canonicalize_file_name+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Index: configure.ac
===================================================================
--- configure.ac	(revision 248482)
+++ configure.ac	(working copy)
@@ -413,13 +413,13 @@ if test "x" = "y"; then
      stpcpy stpncpy strcasecmp strchr strdup \
      strerror strncasecmp strndup strnlen strrchr strsignal strstr strtod \
      strtol strtoul strtoll strtoull strverscmp sysconf sysctl sysmp \
     table times tmpnam \
     vasprintf vfprintf vprintf vsprintf \
     wait3 wait4 waitpid)
-  AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, vsnprintf, strtol, strtoul, strtoll, strtoull])
+  AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, vsnprintf, strtol, strtoul, strtoll, strtoull, strnlen])
   AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if you have the sys_errlist variable.])
   AC_DEFINE(HAVE_SYS_NERR,    1, [Define if you have the sys_nerr variable.])
   AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if you have the sys_siglist variable.])
 fi
 
 # For each of these functions, if the host does not provide the
@@ -686,12 +686,13 @@ if test -z "${setobjs}"; then
 
   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])
+  AC_CHECK_DECLS([strnlen])
   libiberty_NEED_DECLARATION(canonicalize_file_name)
 fi
 
 # Figure out which version of pexecute to use.
 case "${host}" in
      *-*-mingw* | *-*-winnt*)	pexecute=pex-win32  ;;

  parent reply	other threads:[~2017-05-26 21:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 15:37 Eli Zaretskii
2017-05-19 15:27 ` Pedro Alves
2017-05-19 15:47   ` Eli Zaretskii
2017-05-19 16:08     ` Pedro Alves
2017-05-19 22:28 ` DJ Delorie
2017-05-19 22:31   ` Pedro Alves
2017-05-19 22:56     ` DJ Delorie
2017-05-19 23:22       ` Pedro Alves
2017-05-20  1:25         ` DJ Delorie
2017-05-22 16:28           ` Pedro Alves
2017-05-26 21:49 ` DJ Delorie [this message]
2017-05-28 18:31   ` Eli Zaretskii
2017-05-31  6:17     ` DJ Delorie
2017-05-31  6:55       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xnwp93e20b.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).