This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Eliminate warnings about snprintf declaration

> Date: Thu, 12 May 2005 11:47:16 -0400
> From: Daniel Jacobowitz <>
> Cc:,
> > > That will only affect libiberty.h when building libiberty; it won't
> > > affect the users of libiberty.
> > 
> > Then how does one cause libiberty/configure to check for these
> > declarations and edit libiberty/config.h accordingly?  I thought one
> > should modify and the regenerate configure, no?
> It doesn't matter.  libiberty/config.h is not a public file; it is only
> used while building libiberty.  Any project that wants a prototype for
> these functions is responsible for the check in its own private
> config.h.

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 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
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/ followed by running Autoconf?  Are you saying
that I should change gdb/ (or some other configure)

Sorry for being so slow.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]