bug-gnulib
[Top][All Lists]
Advanced

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

%a format in tests-ulc*.c


From: Gisle Vanem
Subject: %a format in tests-ulc*.c
Date: Wed, 19 Apr 2017 14:13:26 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

When using MSVC-2015 to build the tests/unistdio/test-ulc-*.c files,
I get ASSERT() on all the '%a' formats. E.g. in 
unistdio/test-ulc-vasnprintf1.exe
and unistdio/test-ulc-printf1.h (line 195):

    char *result =
      my_xasprintf ("%a %d", 3.1416015625, 33, 44, 55);
    ASSERT (result != NULL);
    ASSERT (strcmp (result, "0x1.922p+1 33") == 0
            || strcmp (result, "0x3.244p+0 33") == 0
            || strcmp (result, "0x6.488p-1 33") == 0
            || strcmp (result, "0xc.91p-2 33") == 0);

The 'result' I get is '0x1.9220000000000p+1 33'.

The MSDN at:
  https://msdn.microsoft.com/en-us/library/hf4y5e3w.aspx

isn't clear on how many digits there should be, but I guess the precision
is a reflection the double float-type.

With "%.3a %d", I do get the expected "0x1.922p+1 33".
So are these tests somewhat gcc-centric or what?

--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]