I've reported the bug to the musl mailing list with a fix patch for the
wprintf implementation.

-- brion

On Wed, Sep 11, 2019 at 3:16 PM Brion Vibber <[email protected]> wrote:

> I think this is a bug in the musl implementation of the standard C
> library; 8-bit printf implements %lf but wide-char wprintf does not. (This
> can be seen in vfprintf.c and vfwprintf.c under
> emscripten/system/lib/libc/musl/src/stdio)
>
> It looks like you can use %F for doubles on both functions, however.
>
> -- brion
>
> On Wed, Sep 11, 2019 at 2:16 PM Юрий Катков <[email protected]> wrote:
>
>> Hello everyone!
>>
>> I'm trying to print double with wprintf in stdout and some format
>> specifiers don't work.
>>
>> int main( int argc, char* argv[] )
>> {
>> double val = 0.123;
>>
>> wprintf( L"1 %lf\n", val ); // FAIL
>> wprintf( L"2 %lf\n", static_cast<float>( val ) ); //FAIL
>> wprintf( L"3 %f\n", val ); // OK
>> wprintf( L"4 %f\n", static_cast<float>( val ) ); // OK
>> printf( "5 %lf\n", val ); // OK
>> printf( "6 %lf\n", static_cast<float>( val ) ); // OK
>> printf( "7 %f\n", val ); // OK
>> printf( "8 %f\n", static_cast<float>( val ) ); // OK
>>
>> return 0;
>> }
>>
>> And what I see in console:
>> 3 0.123000
>> 4 0.123000
>> 5 0.123000
>> 6 0.123000
>> 7 0.123000
>> 8 0.123000
>>
>> Why %ls doesn't work with wprintf ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/e4cce172-ac25-45f7-9bd1-879b96208c23%40googlegroups.com
>> <https://groups.google.com/d/msgid/emscripten-discuss/e4cce172-ac25-45f7-9bd1-879b96208c23%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAFnWYTkr7Oyf5qG3D6yH2xwE6T4nexgoFdHJSTPdpPH1%3DDR4bg%40mail.gmail.com.

Reply via email to