Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 14 Dec 2016 15:46:40 +0200
From: "Nadav Har'El" <>
Cc: "Nadav Har'El" <>
Subject: Handling of L and ll prefixes different from glibc


Posix's printf manual suggests (see
that the "ll" format prefix should only be used for integer types, and "L"
should only be used for long double type. And it seems that indeed, this is
what Musl's printf() supports - the test program

    long double d = 123.456;
    printf("Lf: %Lf\n", d);
    printf("llf %llf\n", d);
    long long int i = 123456;
    printf("Ld: %Ld\n", i);
    printf("lld: %lld\n", i);

produces with Musl's printf just two lines of output:

    Lf: 123.456000
    lld: 123456

The two other printf()s (with %Ld and %llf) are silently dropped.

However, in glibc, it seems that "ll" and "L" are synonyms, and both work
for both integer and floating types. The above program produces with glibc
four lines of output:

    Lf: 123.456000
    llf 123.456000
    Ld: 123456
    lld: 123456

If Musl's intention is to be compatible with glibc, not Posix, I guess this
behavior should be fixed, and LL and ll should become synonyms, not
different flags?


Nadav Har'El

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.