This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/50992] abs() and cabs()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]