[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
vasprintf on DEC [was: m4-1.4.7 build feedback]
From: |
Eric Blake |
Subject: |
vasprintf on DEC [was: m4-1.4.7 build feedback] |
Date: |
Tue, 26 Sep 2006 20:26:43 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666 |
-----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 address@hidden
-----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-----
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], (continued)
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Nelson H. F. Beebe, 2006/09/27
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Eric Blake, 2006/09/27
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Ralf Wildenhues, 2006/09/27
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Andreas Schwab, 2006/09/27
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Eric Blake, 2006/09/27
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Andreas Schwab, 2006/09/28
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Joseph S. Myers, 2006/09/28
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Nelson H. F. Beebe, 2006/09/28
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Joseph S. Myers, 2006/09/28
- Re: depcomp deficiency [was: m4-1.4.7 build feedback], Ralf Wildenhues, 2006/09/28
vasprintf on DEC [was: m4-1.4.7 build feedback],
Eric Blake <=
fpending issues on LSB [was: m4-1.4.7 build feedback], Eric Blake, 2006/09/26