Coming to think about it, compiling your code as C++ rather than C will probably do that for you.Hello all, As you may have guessed I have a C question.
I have searched the gcc warning options
http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Warning-Options.html#Warning%20Options
but failed to find a way to make the compiler warn about implicit casts to shorter types. Especially I am interested in warning about implicit casting of double to int, such as the code in the subject:
int a=1.6;
Can this be done?
Thanks, Orna.
p.s. I spent about a day chasing this bug, because later on I used double b=a;
:(
While C++ is not fully "backwards" compatible to C, most of the differences are in exactly those places you want to catch (stricter type checking and such).
Shachar
-- Shachar Shemesh Lingnu Open Systems Consulting http://www.lingnu.com/
-------------------------------------------------------------------------- Haifa Linux Club Mailing List (http://www.haifux.org) To unsub send an empty message to [EMAIL PROTECTED]
