lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I can recommend a portable (v)snprintf from

----- Original Message -----
From: "Renato Crivano" <>
To: "Multiple recipients of list" <>
Sent: Saturday, August 17, 2002 9:24 AM
Subject: Lua dependency on *printf

> > vsprintf does far more than is necessary to convert a number
> > to a string, and if this is the only place where *printf is
> > used, then it is a waste and should be removed.
> I agree. While porting Lua to PalmOS, I had to include a complete printf
> module. Lua code compiled to 50kb and *printf alone took another 5kb. It
> a 10% memory increment that can only be justified if it is truly
> I also took me quite some time to find a PalmOS compatible printf module.
> So, porting would have been easier if Lua had no *printf references.
> BTW, other porting difficulty I had was with the "strtod" function that
> misses PalmOS support. The solution, in that case, was much easier. I used
> the old lua0_str2d routine. IMO, it would be better to leave Lua without
> strtod dependency too.
> []s,
> Renato Crivano
> Diretor de Tecnologia
> Hands Mobile Solutions
> Tel +55 21 2223-3399