[gdal-dev] Question about json-c mods in changeset r18545

Mateusz Loskot mateusz at loskot.net
Sun Apr 29 15:28:01 EDT 2012


On 28 April 2012 23:38, Even Rouault <even.rouault at mines-paris.org> wrote:
>>
>> Long story short, for printf:
>> %f -> double
>> %Lf -> for long double.
>>
>> for scanf::
>> %f -> float
>> %lf -> double
>> %Lf -> for long double.
>>
>> Or, I'm misunderstanding the C99 document.
>> If I'm correct, then all C99 compilers should printf using %Lf
>> but not %lf, thus json-c is incorrect and I have the basis to suggest
>> the json-c maintainers to fix it.
>>
>> Even, would you agree?
>
> yes, in json-c, long double isn't used, so "%f" should be sufficient. With
> mingw, using "%lf" is dangerous since apparently it triggers a bad interaction
> between a Microsoft extension and possibly a bad implementation in mingw. I'm
> not yet sure to have understood what really happens though.

OK, the proposed fix has been accepted into the json-c and will be
released in json-c 1.0

https://github.com/json-c/json-c/commit/0cc1db6459035fd071371281daff030e5a0e9b8e

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list