This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
why can I pass doubles to "abs"?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: why can I pass doubles to "abs"?
- From: Jennifer Frazier Bryan <jenny at stat dot Berkeley dot EDU>
- Date: Fri, 14 Apr 2000 13:55:24 -0700 (PDT)
Hi. I'm using gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2
release) from the RedHat 6.1 distribution. I cannot get gcc to complain
when double arguments are passed to "abs". I am including <stdlib.h>,
I've tried "#undef abs" and "(abs)" to force a function instead of a
macro. I've also set every -W flag that seems remotely relevant. No
warnings, no errors -- although it does complain when I do something
really outrageous, like pass a function pointer to "abs". Please tell me
where I'm going wrong.
a) Is it stupid or naive to want a warning when I pass a double argument
to "abs" (e.g. I obviously menat to use "fabs")?
b) Am I failing to tell gcc that I want that kind of a warning?
Thanks,
===========================================================
Jenny Bryan Biostatistics, UC Berkeley
jenny@stat.berkeley.edu
===========================================================