Re: Re: mdk-1.0 and snprintf()

Jose Antonio Ortega Ruiz <[email protected]> 09 Apr 2002 16:34:47 -0400
Newsgroups gmane.comp.gnu.mdk.bugs
Message-ID <[email protected]>
hi nelson,

i think your solution below will indeed work, but i've thouhgt of a
cleaner one: i can replace snprintf() by g_snprintf(), from glib: it
is supposed to be portable to systems not providing the non-standard
one (in fact, i should have been using g_snprintf from the
beginning... sloppy coding on my side :( ).

what do you think? could you please check that this function is indeed
supported in your architecture?

thanks a lot for your feedback!

best regards,
jao



"Nelson H. F. Beebe" <[email protected]> writes:

> As a followup to my previous note about the use of the nonstandard
> snprintf() function in mdk-1.0, I just found that the rsync
> distribution from, e.g.,
> 
> 	ftp://rsync.samba.org/pub/rsync/rsync-2.5.5.tar.gz
> 
> contains an implementation of snprintf(), whose comment header begins
> 
> /*
>  * Copyright Patrick Powell 1995
>  * This code is based on code written by Patrick Powell ([email protected])
>  * It may be used for any purpose as long as this notice remains intact
>  * on all source code distributions
>  */
> 
> As an experiment, I copied that file into the mdk-1.0/lib directory,
> added it to the library with
> 
> 	make snprintf.o
> 	ar r libreplace.a snprintf.o
> 	ranlib libreplace.a
> 
> then in the top-level directory, overrode the long LIBS setting by
> inserting a reference to libreplace.a at the start:
> 
> 	make LIBS='-L/local/build/mdk-1.0/lib -lreplace -lhistory \
> 		-lreadline -lncurses  -L/usr/local/lib -lguile -lm \
> 		-L/usr/local/lib -lgmodule -lglib -L/usr/local/lib \
> 		-L/usr/local/lib -lgtk -lgdk -lgmodule -lglib -lintl \
> 		-lXext -lXext -lX11 -ldnet_stub -lm' check
> 
> All of the validation tests then passed.
> 
> It should thus be a simple matter in future mdk releases to
> incorporate this implementation of snprintf().
> 
> -------------------------------------------------------------------------------
> - Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
> - Center for Scientific Computing       FAX: +1 801 585 1640, +1 801 581 4148 -
> - University of Utah                    Internet e-mail: [email protected]  -
> - Department of Mathematics, 110 LCB        [email protected]  [email protected] -
> - 155 S 1400 E RM 233                       [email protected]                    -
> - Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
> -------------------------------------------------------------------------------
> 
> _______________________________________________
> bug-mdk mailing list
> [email protected]
> http://mail.gnu.org/mailman/listinfo/bug-mdk
> 

-- 
Keep me away from the wisdom which does not cry, the philosophy which does
not laugh and the greatness which does not bow before children.
                       -Kahlil Gibran, mystic, poet and artist (1883-1931)