This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50992] abs() and cabs()
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Nov 2011 15:08:09 +0000
- Subject: [Bug c/50992] abs() and cabs()
- Auto-submitted: auto-generated
- References: <bug-50992-4@http.gcc.gnu.org/bugzilla/>
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.