httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: PLEASE try compiling snprintf.c (was: Re: snprintf.c uploaded)
Date Sun, 12 Jan 1997 18:17:31 GMT
On Sun, 12 Jan 1997, Jim Jagielski wrote:

> Jim Jagielski wrote:
> > 
> > Yeah.... As you can see, the snprintf/vsnprintf() stuff uses slightly
> > different prototypes as does the usual version. Renaming them to
> > something like ap_snprintf/ap_vsnprintf() will avoid that. I am
> > actually planning on ANSIfying the entire core...
> > 
> 
> Which is done. I also switched to using stdarg instead of varargs.
> 
> Uploaded as ap_snprintf.c in /pub/httpd/incoming
> 
> I'll fold Marc's changes in as well when he's done.

Try linking something and you will notice that you need cvt, gcvt, etc.
I think cvt.c and gvct.c are all that I needed to add to make it work.
>From my tests, I think there are a few bugs to hunt down in the code
too...

On Sun, 12 Jan 1997, Jim Jagielski wrote:

> Yeah.... As you can see, the snprintf/vsnprintf() stuff uses slightly
> different prototypes as does the usual version. Renaming them to
> something like ap_snprintf/ap_vsnprintf() will avoid that. I am
> actually planning on ANSIfying the entire core...

Funny, the patches I have started already use ap_snprintf for the name.
<g>  

I think what we should end up doing is something like:

#if defined(HAVE_SNPRINTF)
#define ap_snprintf snprintf
#define ap_vsnprintf vsnprintf
#elif defined(USE_SPRINTF_FOR_SNPRINTF)
/* big comment about how bad this is */
(wrappers to call sprintf)
#else
(stuff for ap_snprintf and ap_vsnpinrtf)
#endif

with the USE_SPRINTF_FOR_SNPRINTF bit being optional.  Personally, I don't
see the harm in including it as long as:
	- there is a nice big scary warning message
	- it is not done automatically at all
	- it isn't even documented outside ap_snprintf.c

For those OSes (ermm... most *BSD*s and Linux I guess) which we know have
snprintf, we can define HAVE_SNPRINTF in conf.h if we want to.

For others, it will use ap_snprintf.  If we don't get all the OSes that
have snprintf, no big deal as long as ap_snprintf works.



Mime
View raw message