From: Daniel Jacobowitz <drow@false.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Eliminate warnings about snprintf declaration
Date: Thu, 12 May 2005 18:07:00 -0000 [thread overview]
Message-ID: <20050512162453.GA5180@nevyn.them.org> (raw)
In-Reply-To: <01c5570e$Blat.v2.4$1c533160@zahav.net.il>
On Thu, May 12, 2005 at 07:16:34PM +0300, Eli Zaretskii wrote:
> I guess I'm missing something obvious, since I still don't get it.
>
> Here's the process of getting these declarations as I understand it:
>
> . the configure script checks whether asprintf, basename, ffs,
> etc. are declared on standard headers
>
> . it then edits config.in into config.h and adds the appropriate
> definitions for HAVE_DECL_ASPRINTF, HAVE_DECL_BASENAME, etc.
>
> . include/libiberty.h then enables its own declarations for those
> platforms for which HAVE_DECL_ASPRINTF etc. say there's a need for
> a declaration
>
> Is the above correct? If so, I need to cause two changes, in addition
The above is correct.
> to modifying include/libiberty.h:
>
> 1) cause the configure script check for declarations of 2 additional
> functions--snprintf and vsnprintf
>
> 2) add #undef's for HAVE_DECL_SNPRINTF and HAVE_DECL_VSNPRINTF which
> will be edited by the configure script
>
> How do I make these two changes, if not by modifications to
> libiberty/configure.ac followed by running Autoconf? Are you saying
> that I should change gdb/configure.ac (or some other configure)
> instead?
That is also correct.
The principle is that any project which uses libiberty, which wants
these definitions, must request them. Libiberty's config.h is included
by libiberty source files, before they include libiberty.h. GDB's
config.h is included by GDB source fles before they include
libiberty.h. So, if GDB needs the prototype, it is GDB's
responsibility to request it.
Basename is an unfortunate example; you can find some discussion of why
on binutils@ over the last few weeks. That's because it returns a
pointer, so a prototype _must_ be available in order to safely use it.
This problem doesn't apply to *printf.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-05-12 16:25 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 [this message]
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
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=20050512162453.GA5180@nevyn.them.org \
--to=drow@false.org \
--cc=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