[Bug c/50992] abs() and cabs()
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 4 15:08:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50992
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
CC| |manu at gcc dot gnu.org
--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-11-04 15:08:09 UTC ---
#include <complex.h>
extern int abs(int);
int foo(void) {
complex double Z = 0.1 + 0.2I;
return abs(Z);
}
GCC says nothing with -Wall -Wextra -Wconversion, because
c-common.c:conversion_warnings() does not handle complex variables.
Clang:
test.c:6:14: warning: implicit conversion discards imaginary component:
'_Complex double' to 'int' [-Wconversion]
return abs(Z);
~~~ ^
1 warning generated.
More information about the Gcc-bugs
mailing list