On Friday 06 April 2001 8:06 am, [EMAIL PROTECTED] wrote:
> Version:
> m4 version 1.4, all operating systems
>
> Problem description:
>
> The format macro returns a wrong output if you specif an integer number
that terminates with a 0, example try to output the number 10 using:
> > format(%f, 10)
>
> 1000000
Agreed. Thanks for the patch -- applied to CVS HEAD.
> One thing I don't understand is why the format command has an own
> implementation, wouldn't it be better to simply use vsprintf() instead ? My
> guess is that vsprintf() is not implemented or not consistent on all
> operating systems ?
There is no portable way to build a va_list in memory to pass to vsprintf --
building an array of void* works with some compilers, provided the memory
alignment expected on the call stack matches the alignment of the array on
the heap. Worse, some compilers implement va_list's without using void*
arrays at all.
Cheers,
Gary.
--
___ _ ___ __ _ mailto: [EMAIL PROTECTED]
/ __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___ [EMAIL PROTECTED]
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
\___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
home page: /___/ /___/ gpg public key:
http://www.oranda.demon.co.uk http://www.oranda.demon.co.uk/key.asc
_______________________________________________
Bug-m4 mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-m4