If you use -ansi to compile a program that uses the atanh function, the compiler somehow replaces atanh with a function that just returns 0. I think the compiler should either put in the correct atanh function or refuses to link/compile. The following shows how to reproduce the bug: $ cat > bug.c #include <math.h> #include <stdio.h> #include <stdlib.h> int main() { printf("atanh(%f) returns %f!\n",.32,atanh(.32)); return 0;} $ gcc bug.c -o bug.exe -lm && bug.exe atanh(0.320000) returns 0.331647! $ gcc -ansi bug.c -o bug.exe -lm && bug.exe atanh(0.320000) returns 0.000000!
Created attachment 11370 [details] .i file created with -save-temps flag
Created attachment 11371 [details] .s file created with -save-temps
Created attachment 11372 [details] output of compiler with --save-temps
t1.c: In function 'main': t1.c:5: warning: implicit declaration of function 'atanh' t1.c:5: warning: format '%f' expects type 'double', but argument 3 has type 'int' You need either -std=c99 or not use -ansi as atanh is a C99 math function and not part of C90. Also this is more of a glibc issue than a GCC one.