This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [MPFR] Re: GNU MPFR 3.1.2 Release Candidate


On Tue, Mar 12, 2013 at 6:54 PM,  <sisyphus1@optusnet.com.au> wrote:
> You have in your test output:
>
>
> Error in mpfr_vsprintf (s, "%.*Zi, %R*e, %Lf", ...);
> expected: "00000010610209857723, -1.2345678875e+07, 0.032258"
> got:      "00000010610209857723, -1.2345678875e+07, 0.000000"
>
> That "0.000000" for the "%Lf" usually indicates that the "%Lf" formatting is
> not supported.
> Is that the case here ? .... or did the test *really* arrive at a wrong
> answer of "0.000000"  ?
>
> With the (gcc-4.7.0) x86_64-w64-mingw32 compiler that I use, I need to first
> define __USE_MINGW_ANSI_STDIO if I want support for "%Lf" formatting:
>
> #############################
> C:\_32\C>type try.c
>
> #include <stdio.h>
>
> int main(void) {
>
>    long double x = 0.347L;
>    printf("%Lf\n", x);
>
>    return 0;
> }
>
>
> C:\_32\C>x86_64-w64-mingw32-gcc -o try.exe try.c
>
> C:\_32\C>try
> 0.000000
>
> C:\_32\C>x86_64-w64-mingw32-gcc -o try.exe -D__USE_MINGW_ANSI_STDIO try.c
>
> C:\_32\C>try
> 0.347000
>
> C:\_32\C>
> #############################
>
> Is it the same for your compiler ?

Yes.

> Was __USE_MINGW_ANSI_STDIO defined when you built mpfr ? (It is *not*
> defined for my build - but I think configure detects that for me, and skips
> any tests that involve the "%Lf" format.)
>
> Cheers,
> Rob
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]