-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Nelson H. F. Beebe on 9/26/2006 8:51 AM: > Machinetype: DEC Alpha 4100-5/466 (4 21164 EV5 CPUs, 466 MHz, 2GB > RAM); OSF/1 4.0F > Remote cc version: DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229) > Configure environment: CC=cc CFLAGS="-ieee -I/usr/local/include" CXX=cxx > CXXFLAGS="-ieee -I/usr/local/include" LDFLAGS="-Wl,-rpath,/usr/local/lib > -Wl,-oldstyle_liblookup -L/usr/local/lib" LIBS="-lsnprintf" FC=f77 F77=f77 > > Checking ./108.format > @ ../doc/m4.texinfo:3779: Origin of test > ./108.format: stdout mismatch > 3c3 > < 56790 > --- >> f > > The problem statement in the test file is this one: > > format(`%.0f', `56789.9876')
You reported the same bug against m4 1.4.5 as well. I'm not sure why your compiler is failing to handle %.0f correctly; m4 uses the gnulib xasprintf module for its formatting, which, IIUC, somewhere under the hood should result in a printf call to your libc. > > I'm not sure why this outputs f instead of 56790. m4 does not appear > to be using the printf() library function, because this test program > produces correct output: > > % cat fmtbug.c > #include <stdio.h> > #include <stdlib.h> > > int > main(void) > { > printf("%.f\n", 56789.9876); > printf("%.0f\n", 56789.9876); > > return (EXIT_SUCCESS); > } > > % cc fmtbug.c && ./a.out > 56790 > 56790 Even weirder. Could you try building a test app that uses xasprintf and links against libm4 built in m4/lib, to further debug the issue? Is [v]sprintf different than plain printf? - -- Life is short - so eat dessert first! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFGeFj84KuGfSFAYARAo+DAJ9XuKGRl56XtZZ3NiQaTZwY6exUUgCgljAP jifeEFMbQHOAw2cme1vj9v8= =wm0X -----END PGP SIGNATURE-----