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]

why can I pass doubles to "abs"?


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
===========================================================







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