during GIMPLE pass: slsr ... internal compiler error: Segmentation fault
Great to hear! Thanks Clint!
Please consider adding extern "C" block to headers for C++ users
Thanks for the extra info, Keith. We may be able to switch to strtod and use the replacements as a workaround in our project.
Thank you for the info Keith and apologies for the noise. I was unaware MinGW was using MSVCRT.dll. Instead, I assumed since the code worked with MSVC that it would work with the runtime used with MinGW. MSVCRT is not C99 compatible and the C89 standard for strtod makes no mention of non-finites. So there's no issue to purue with Microsoft as far as I see.
I've got an errant const in the code here's what it should be and the updated attachment: #include <stdio.h> #include <stdlib.h> void main() { char s[256]; double d; float f; while (1) { d = 0.0; f = 0.0; printf("Enter value: "); scanf("%s",&s[0]); printf("s = %s\n",s); sscanf(s,"%lf",&d); printf("sscanf %%lf says d = %g\n",d); sscanf(s,"%f",&f); printf("sscanf %%f says f = %g\n",f); d = strtod(s,NULL); printf("strtod says d = %g\n",d); f = strtof(s,NULL); printf("strtof says f = %g\n\n",f); } }
I've got an errant const in the code here's what it should be and the updated attachment: #include <stdio.h> #include <stdlib.h> void main() { char s[256]; double d; float f; while (1) { d = 0.0; f = 0.0; printf("Enter value: "); scanf("%s",&s[0]); printf("s = %s\n",s); sscanf(s,"%lf",&d); printf("sscanf %%lf says d = %g\n",d); sscanf(s,"%f",&f); printf("sscanf %%f says f = %g\n",f); d = strtod(s,NULL); printf("strtod says d = %g\n",d); f = strtof(s,NULL); printf("strtof says f = %g\n\n",f); } }
scanf doesn't parse non-finite floating point strings like "Inf" and "NaN"