public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: [RFA] Eliminate warnings about snprintf declaration
       [not found]                   ` <20050514141204.GA10684@nevyn.them.org>
@ 2005-05-14 19:02                     ` Eli Zaretskii
  2005-05-15 16:52                       ` Ian Lance Taylor
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2005-05-14 19:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: gdb-patches, binutils

> Date: Sat, 14 May 2005 10:12:04 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com
> 
> > Actually, I found that a simpler patch to include/libiberty.h (below)
> > is all that is needed to fix all the warnings about snprintf and
> > vsnprintf.  libiberty.h already does that for asprintf and vasprintf,
> > so I think we can use the same method for snprintf and vsnprintf; no
> > need to change any configure.ac files.
> 
> > 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> > 
> > 	* libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if
> > 	needed.
> > 	(vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed.
> 
> Note that this will only work if there are no systems which declare
> snprintf with an incorrect prototype.  For instance, a missing const on
> the format string in a system header would now generate an error.  For
> asprintf this isn't an issue, because it's not a standard function;
> it's only provided by glibc.

Actually, what I wrote was completely bogus: without adding these
functions to AC_CHECK_DECLS, the respective HAVE_DECL_* macros will
never get defined, so what I suggested is equivalent to including
these prototypes unconditionally, which is certainly not what I meant.
Sorry.

Here's a revised patch, now together with the configury stuff.


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

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


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

	* configure.in: Add snprintf and vsnprintf to AC_CHECK_DECLS.


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

	* configure.ac: Add snprintf and vsnprintf to AC_CHECK_DECLS.


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	14 May 2005 16:09:49 -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: 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	14 May 2005 16:10:11 -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=
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	14 May 2005 16:10:31 -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.  #
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	14 May 2005 16:10:46 -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
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-14 19:02                     ` [RFA] Eliminate warnings about snprintf declaration Eli Zaretskii
@ 2005-05-15 16:52                       ` Ian Lance Taylor
  2005-05-15 17:28                         ` Daniel Jacobowitz
  2005-05-15 19:55                         ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Lance Taylor @ 2005-05-15 16:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gcc-patches, gdb-patches, binutils

"Eli Zaretskii" <eliz@gnu.org> writes:

> include/ChangeLog:
> 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> 
> 	* libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if
> 	needed.
> 	(vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed.
> 
> 
> 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.

> gdb/ChangeLog:
> 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> 
> 	* configure.ac: Add snprintf and vsnprintf to AC_CHECK_DECLS.

I can't approve this one, but it looks fine to me.

Ian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-15 16:52                       ` Ian Lance Taylor
@ 2005-05-15 17:28                         ` Daniel Jacobowitz
  2005-05-15 19:48                           ` Eli Zaretskii
  2005-05-15 19:55                         ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2005-05-15 17:28 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Eli Zaretskii, gcc-patches, gdb-patches, binutils

On Sun, May 15, 2005 at 12:29:11PM -0400, Ian Lance Taylor wrote:
> "Eli Zaretskii" <eliz@gnu.org> writes:
> 
> > include/ChangeLog:
> > 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> > 
> > 	* libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if
> > 	needed.
> > 	(vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed.
> > 
> > 
> > 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.

> > gdb/ChangeLog:
> > 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> > 
> > 	* configure.ac: Add snprintf and vsnprintf to AC_CHECK_DECLS.
> 
> I can't approve this one, but it looks fine to me.

Eli can approve it himself; or I will :-)  Same comment as above
applies; please mention configure.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-15 17:28                         ` Daniel Jacobowitz
@ 2005-05-15 19:48                           ` Eli Zaretskii
  2005-05-15 20:26                             ` Daniel Jacobowitz
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2005-05-15 19:48 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gdb-patches, binutils

> 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?

> > > gdb/ChangeLog:
> > > 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> > > 
> > > 	* configure.ac: Add snprintf and vsnprintf to AC_CHECK_DECLS.
> > 
> > I can't approve this one, but it looks fine to me.
> 
> Eli can approve it himself; or I will :-)

True; but given the problems in my original patch, I prefered to get
this by you-all.

> Same comment as above applies; please mention configure.

(And config.in, right?)  Will do.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-15 16:52                       ` Ian Lance Taylor
  2005-05-15 17:28                         ` Daniel Jacobowitz
@ 2005-05-15 19:55                         ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2005-05-15 19:55 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gdb-patches, binutils

> Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org,
>   binutils@sourceware.org
> From: Ian Lance Taylor <ian@airs.com>
> Date: 15 May 2005 12:29:11 -0400
> 
> "Eli Zaretskii" <eliz@gnu.org> writes:
> 
> > include/ChangeLog:
> > 2005-05-14  Eli Zaretskii  <eliz@gnu.org>
> > 
> > 	* libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if
> > 	needed.
> > 	(vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed.
> > 
> > 
> > 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.

Thank you.

Could someone please commit these?  I don't have write access to bfd
and gcc repositories.

TIA

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-15 19:48                           ` Eli Zaretskii
@ 2005-05-15 20:26                             ` Daniel Jacobowitz
  2005-05-20 12:55                               ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Jacobowitz @ 2005-05-15 20:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Ian Lance Taylor, gcc-patches, gdb-patches, binutils

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.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-15 20:26                             ` Daniel Jacobowitz
@ 2005-05-20 12:55                               ` Eli Zaretskii
  2005-05-28 11:38                                 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2005-05-20 12:55 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gdb-patches, binutils

> 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.  #

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-20 12:55                               ` Eli Zaretskii
@ 2005-05-28 11:38                                 ` Eli Zaretskii
  2005-05-28 12:43                                   ` Andreas Jaeger
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2005-05-28 11:38 UTC (permalink / raw)
  To: gcc-patches, binutils

1-week ping.  Would someone with write access to GCC and Binutils CVS
trees please commit these changes, and also regenerate config.in and
configured where the ChangeLog entries say so?

TIA


> Date: Fri, 20 May 2005 14:27:24 +0300
> From: "Eli Zaretskii" <eliz@gnu.org>
> CC: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org,
>         binutils@sourceware.org
> 
> > 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.  #
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-28 11:38                                 ` Eli Zaretskii
@ 2005-05-28 12:43                                   ` Andreas Jaeger
  2005-05-28 21:48                                     ` Eli Zaretskii
  2005-05-30 17:50                                     ` DJ Delorie
  0 siblings, 2 replies; 11+ messages in thread
From: Andreas Jaeger @ 2005-05-28 12:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gcc-patches, binutils

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> 1-week ping.  Would someone with write access to GCC and Binutils CVS
> trees please commit these changes, and also regenerate config.in and
> configured where the ChangeLog entries say so?

I'll take care of it now.

I assume that the include and libiberty changes are synced
automatically from GCC to binutils - if this is not correct, please
tell me and I'll commit there as well (I'll check also in 24 hours
myself),

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-28 12:43                                   ` Andreas Jaeger
@ 2005-05-28 21:48                                     ` Eli Zaretskii
  2005-05-30 17:50                                     ` DJ Delorie
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2005-05-28 21:48 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: gcc-patches, binutils

> From: Andreas Jaeger <aj@suse.de>
> Cc: gcc-patches@gcc.gnu.org, binutils@sourceware.org
> Date: Sat, 28 May 2005 13:38:11 +0200
> 
> > 1-week ping.  Would someone with write access to GCC and Binutils CVS
> > trees please commit these changes, and also regenerate config.in and
> > configured where the ChangeLog entries say so?
> 
> I'll take care of it now.

Thanks.

> I assume that the include and libiberty changes are synced
> automatically from GCC to binutils - if this is not correct, please
> tell me

Sorry, I don't know if this is correct or not.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFA] Eliminate warnings about snprintf declaration
  2005-05-28 12:43                                   ` Andreas Jaeger
  2005-05-28 21:48                                     ` Eli Zaretskii
@ 2005-05-30 17:50                                     ` DJ Delorie
  1 sibling, 0 replies; 11+ messages in thread
From: DJ Delorie @ 2005-05-30 17:50 UTC (permalink / raw)
  To: aj; +Cc: eliz, gcc-patches, binutils


> I assume that the include and libiberty changes are synced
> automatically from GCC to binutils

Yes.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-05-30 16:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <41994B9D.9080809@gnu.org>
     [not found] ` <01c55702$Blat.v2.4$d4764900@zahav.net.il>
     [not found]   ` <20050512150804.GA1808@nevyn.them.org>
     [not found]     ` <01c55708$Blat.v2.4$cfc9f040@zahav.net.il>
     [not found]       ` <20050512154716.GA3513@nevyn.them.org>
     [not found]         ` <01c5570e$Blat.v2.4$1c533160@zahav.net.il>
     [not found]           ` <20050512162453.GA5180@nevyn.them.org>
     [not found]             ` <01c55732$Blat.v2.4$e9bd3640@zahav.net.il>
     [not found]               ` <20050512205103.GB13519@nevyn.them.org>
     [not found]                 ` <01c5586c$Blat.v2.4$a7dfc720@zahav.net.il>
     [not found]                   ` <20050514141204.GA10684@nevyn.them.org>
2005-05-14 19:02                     ` [RFA] Eliminate warnings about snprintf declaration Eli Zaretskii
2005-05-15 16:52                       ` Ian Lance Taylor
2005-05-15 17:28                         ` Daniel Jacobowitz
2005-05-15 19:48                           ` Eli Zaretskii
2005-05-15 20:26                             ` Daniel Jacobowitz
2005-05-20 12:55                               ` Eli Zaretskii
2005-05-28 11:38                                 ` Eli Zaretskii
2005-05-28 12:43                                   ` Andreas Jaeger
2005-05-28 21:48                                     ` Eli Zaretskii
2005-05-30 17:50                                     ` DJ Delorie
2005-05-15 19:55                         ` Eli Zaretskii

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).