This is the mail archive of the
sid@sources.redhat.com
mailing list for the SID project.
Re: Using vsnprintf or vasprintf in sid
- From: Ben Elliston <bje at wasabisystems dot com>
- To: sid at sources dot redhat dot com
- Date: 26 May 2003 14:44:18 +1000
- Subject: Re: Using vsnprintf or vasprintf in sid
- References: <3ECE6412.7040007@redhat.com>
Hi Dave!
Dave Brolley <brolley@redhat.com> writes:
> I have a need for printf-like printing into a buffer, however I have
> no control over the input and so I don't know the size of the buffer
> which will be required. It looks like vsnprintf (_ISOC99_SOURCE) or
> vasprintf (_GNU_SOURCE) are what I need. Is it ok to use these
> function in sid and, if so, how do I get configure to add the
> necessary -Dxxxx to the sid compilations and (if necessary) specify
> the library to look in?
I'm not aware of any policy (the problem with SID is that it lacks the
strict policies and exciting politics of other free software
projects!) that would prevent you from using either of these functions
in SID, provided that you use Autoconf tests as you suggest. I think
it's important to have a fall-back implementation, though, in the case
that neither is available.
Take a look at using AC_CHECK_FUNC to do the test and set a #define in
config.h to indicate the function(s) presence. If you can, try and
isolate the test to the configure script used in the part of the
source tree you're working in rather than running the test in the
top-level configure script.
Cheers, Ben