builtin sscanf

Jeff Law law@redhat.com
Wed Oct 19 20:05:00 GMT 2016


On 10/19/2016 12:45 PM, fedor_qd wrote:
> How precize this function?
> I write sample:
> int main()
>     {
>     float x, y;
>     __builtin_sscanf("30,981", "%f", &x);
>     __builtin_printf("Test comma: %f\n", x);
>     return(0);
>     }
>
> Compile with options: g++ main.c -o hello -static-libgcc
>
> This sample returns 30.00 but 30.981 expected
That would depend on your host implementation of printf/scanf and is 
outside of GCC's control.

jeff





More information about the Gcc-help mailing list