Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
To: Ian Lance Taylor <ian@airs.com>
Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org,
	binutils@sourceware.org
Subject: Re: [RFA] Eliminate warnings about snprintf declaration
Date: Fri, 20 May 2005 12:42:00 -0000	[thread overview]
Message-ID: <01c55d2f$Blat.v2.4$0dc6b6e0@zahav.net.il> (raw)
In-Reply-To: <20050515195522.GA19088@nevyn.them.org> (message from Daniel Jacobowitz on Sun, 15 May 2005 15:55:23 -0400)

> Date: Sun, 15 May 2005 15:55:23 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Ian Lance Taylor <ian@airs.com>, gcc-patches@gcc.gnu.org,
> 	gdb-patches@sourceware.org, binutils@sourceware.org
> 
> On Sun, May 15, 2005 at 10:40:59PM +0300, Eli Zaretskii wrote:
> > > Date: Sun, 15 May 2005 13:04:35 -0400
> > > From: Daniel Jacobowitz <drow@false.org>
> > > Cc: Eli Zaretskii <eliz@gnu.org>, gcc-patches@gcc.gnu.org,
> > > 	gdb-patches@sourceware.org, binutils@sourceware.org
> > > 
> > > > > bfd/ChangeLog:
> > > > > 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> > > > > 
> > > > > 	* configure.in: Add snprintf and vsnprintf to AC_CHECK_DECLS.
> > > > 
> > > > These patches are approved, plus the change to libiberty/configure.ac
> > > > which needs the obvious ChangeLog entry.  Thanks.
> > > 
> > > Eli, please mention regenerating configure in the ChangeLog.
> > 
> > I didn't send patches for the (regenerated) configure and config.in.
> > Should I do that, given that I cannot commit them anyway?
> 
> No, you don't need to.  If you mention them in the ChangeLog, that'll
> serve as a hint to whoever commits the patch which files need to be
> regenerated.
> 
> > > Same comment as above applies; please mention configure.
> > 
> > (And config.in, right?)  Will do.
> 
> Good catch.  Yes, thank you.

Okay, here's the revised patch with revised ChangeLog entries.  I will
commit the GDB part shortly, but I need someone else to commit the
patches in bfd/, include/, and libiberty/.  TIA

libiberty/ChangeLog:
2005-05-20  Eli Zaretskii  <eliz@gnu.org>

	* configure.ac: Add snprintf and vsnprintf to AC_CHEK_DECLS.
	* config.in, configure: Regenerate.

include/ChangeLog:
2005-05-20  Eli Zaretskii  <eliz@gnu.org>

	* libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if
	needed.
	(vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed.

gdb/ChangeLog:
2005-05-20  Eli Zaretskii  <eliz@gnu.org>

	* configure.ac: Add snprintf and vsnprintf to AC_CHECK_DECLS.
	* config.in, configure: Regenerate.

bfd/ChangeLog:
2005-05-20  Eli Zaretskii  <eliz@gnu.org>

	* configure.in: Add snprintf and vsnprintf to AC_CHECK_DECLS.
	* config.in, configure: Regenerate.


Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.183
diff -u -r1.183 configure.in
--- bfd/configure.in	10 May 2005 01:27:53 -0000	1.183
+++ bfd/configure.in	20 May 2005 11:16:55 -0000
@@ -144,6 +144,8 @@
 AC_CHECK_DECLS(realloc)
 AC_CHECK_DECLS(stpcpy)
 AC_CHECK_DECLS(strstr)
+AC_CHECK_DECLS(snprintf)
+AC_CHECK_DECLS(vsnprintf)
 
 # If we are configured native, pick a core file support file.
 COREFILE=
cvs diff: I know nothing about gdb/configure.in
Index: include/libiberty.h
===================================================================
RCS file: /cvs/src/src/include/libiberty.h,v
retrieving revision 1.44
diff -u -r1.44 libiberty.h
--- include/libiberty.h	12 May 2005 20:00:35 -0000	1.44
+++ include/libiberty.h	20 May 2005 11:20:18 -0000
@@ -531,6 +531,16 @@
   ATTRIBUTE_PRINTF(2,0);
 #endif
 
+#if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF
+/* Like sprintf but prints at most N characters.  */
+extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3;
+#endif
+
+#if defined(HAVE_DECL_VSNPRINTF) && !HAVE_DECL_VSNPRINTF
+/* Like vsprintf but prints at most N characters.  */
+extern int vsnprintf (char *, size_t, const char *, va_list);
+#endif
+
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 /* Drastically simplified alloca configurator.  If we're using GCC,
Index: libiberty/configure.ac
===================================================================
RCS file: /cvs/src/src/libiberty/configure.ac,v
retrieving revision 1.22
diff -u -r1.22 configure.ac
--- libiberty/configure.ac	7 May 2005 02:00:41 -0000	1.22
+++ libiberty/configure.ac	20 May 2005 11:22:47 -0000
@@ -282,7 +282,7 @@
   sysconf times sbrk gettimeofday ffs snprintf vsnprintf \
   pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl wait3 wait4 \
   realpath canonicalize_file_name __fsetlocking)
-  AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf])
+  AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf])
   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.])
@@ -518,7 +518,7 @@
     [AC_MSG_RESULT([no])])
 
   AC_CHECK_FUNCS($checkfuncs)
-  AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf])
+  AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf])
   libiberty_NEED_DECLARATION(canonicalize_file_name)
 fi
 
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.18
diff -u -r1.18 configure.ac
--- gdb/configure.ac	21 Apr 2005 05:34:33 -0000	1.18
+++ gdb/configure.ac	20 May 2005 11:28:33 -0000
@@ -418,7 +418,7 @@
 
 AC_CHECK_DECLS([free, malloc, realloc])
 AC_CHECK_DECLS([strerror, strstr])
-AC_CHECK_DECLS(getopt)
+AC_CHECK_DECLS([getopt, snprintf, vsnprintf])
 
 # ----------------------- #
 # Checks for structures.  #


  reply	other threads:[~2005-05-20 11:31 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01c4c990$Blat.v2.2.2$887ec720@zahav.net.il>
     [not found] ` <41994B9D.9080809@gnu.org>
2005-05-12 15:08   ` Eli Zaretskii
2005-05-12 15:33     ` Daniel Jacobowitz
2005-05-12 15:45       ` Eli Zaretskii
2005-05-12 15:53         ` Daniel Jacobowitz
2005-05-12 16:25           ` Eli Zaretskii
2005-05-12 18:07             ` Daniel Jacobowitz
2005-05-12 20:48               ` Eli Zaretskii
2005-05-12 21:05                 ` Daniel Jacobowitz
2005-05-12 21:27                   ` DJ Delorie
2005-05-14 10:23                   ` Eli Zaretskii
2005-05-14 16:39                     ` Daniel Jacobowitz
2005-05-14 19:43                       ` Eli Zaretskii
2005-05-15 16:31                         ` Ian Lance Taylor
2005-05-15 17:15                           ` Daniel Jacobowitz
2005-05-15 19:48                             ` Eli Zaretskii
2005-05-15 20:21                               ` Daniel Jacobowitz
2005-05-20 12:42                                 ` Eli Zaretskii [this message]
2005-05-20 14:16                             ` Eli Zaretskii
2005-05-20 14:34                               ` Andreas Schwab
2005-05-20 15:02                                 ` Eli Zaretskii
2005-05-20 15:06                                   ` Andreas Schwab
2005-05-20 18:24                                     ` Eli Zaretskii
2005-05-20 18:26                                       ` Eli Zaretskii
2005-05-20 20:47                                         ` Daniel Jacobowitz
2005-05-20 22:16                                           ` Eli Zaretskii
2005-05-22 14:54                                             ` Daniel Jacobowitz
2005-05-22 17:11                                             ` Andreas Schwab
2005-05-15 19:55                           ` Eli Zaretskii
2005-05-12 16:01         ` Ian Lance Taylor

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='01c55d2f$Blat.v2.4$0dc6b6e0@zahav.net.il' \
    --to=eliz@gnu.org \
    --cc=binutils@sourceware.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ian@airs.com \
    /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