jmeubank / tdm-gcc

TDM-GCC is a cleverly disguised GCC compiler for Windows!
https://jmeubank.github.io/tdm-gcc/
570 stars 49 forks source link

printf issues #9

Open p-j-miller opened 4 years ago

p-j-miller commented 4 years ago

The following short program (renamed bug2.c and compiled) shows 2 bugs in the printf family. The 2nd seems to cause an infinite loop (ie executable "stops"). bugs2 .txt The 1st is : r=printf("%5g",(double) 1000); // returns 4 and only prints "1000" ! the 2nd is: printf("%.5A",(double)0); // This line causes a crash (stuck in an infinite loop?) at run time !

p-j-miller commented 3 years ago

A solution to this is to use ya-sprintf at https://github.com/p-j-miller/ya-sprintf . This also includes a strtod() function that is significantly faster than the one in TDM-gcc 9

jmeubank commented 3 years ago

This bug is still present in the latest releases of MinGW-w64 and should be reported there.

p-j-miller commented 3 years ago

Thanks for looking into this. Now for the "silly" question - how do I report it to MinGW-w64, I cannot raise a ticket at https://sourceforge.net/p/mingw-w64/bugs/ which seemed to be the correct approach?