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

Even Rouault even.rouault at mines-paris.org
Sat Apr 28 18:38:20 EDT 2012


> 
> 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.


More information about the gdal-dev mailing list