This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53603] abs() doesn't warn if argument is double, not even with -Wall -Wextra
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Jun 2012 13:55:05 +0000
- Subject: [Bug c/53603] abs() doesn't warn if argument is double, not even with -Wall -Wextra
- Auto-submitted: auto-generated
- References: <bug-53603-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53603
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-06-07 13:55:05 UTC ---
Use -Wconversion:
[macbook] f90/bug% gcc48 -Wconversion pr53603.c
pr53603.c: In function 'main':
pr53603.c:6:9: warning: conversion to 'int' from 'double' may alter its value
[-Wconversion]
y = abs (x);
^
although I'ld expect the caret under x. For 4.4 to 4.7 one gets
pr53603.c: In function 'main':
pr53603.c:6: warning: conversion to 'int' from 'double' may alter its value