Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Eliminate warnings about snprintf declaration
Date: Sat, 14 May 2005 10:23:00 -0000	[thread overview]
Message-ID: <01c5586c$Blat.v2.4$a7dfc720@zahav.net.il> (raw)
In-Reply-To: <20050512205103.GB13519@nevyn.them.org> (message from Daniel Jacobowitz on Thu, 12 May 2005 16:51:03 -0400)

> Date: Thu, 12 May 2005 16:51:03 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com
> 
> > So I need to add these functions to gdb/configure.ac _and_ to
> > libiberty/configure.ac; got it.  I will post a revised patch soon.
> > 
> > Thanks for your patience.
> 
> Almost - you don't actually need them in libiberty/configure.ac, unless
> you see warnings about them during the build of libiberty.  To make GDB
> -Werror happy, all you need is gdb/configure.ac and
> include/libiberty.h.

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.

Okay?

2005-05-14  Eli Zaretskii  <eliz@gnu.org>

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

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 10:08:37 -0000
@@ -531,6 +531,16 @@
   ATTRIBUTE_PRINTF(2,0);
 #endif
 
+#if !HAVE_DECL_SNPRINTF
+/* Like sprintf but prints at most N characters.  */
+extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3;
+#endif
+
+#if !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,


  parent reply	other threads:[~2005-05-14 10:10 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 [this message]
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
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='01c5586c$Blat.v2.4$a7dfc720@zahav.net.il' \
    --to=eliz@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sources.redhat.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