On Thu, 1 Jan 2004, Orna Agmon wrote:

> 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 implicitcasts 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?

try using splint, which can catch this type of mistake and more:
http://lclint.cs.virginia.edu/

 Meir.

> Thanks,
>       Orna.
>
> p.s.
>       I spent about a day chasing this bug, because later on I used
> double b=a;
>
> :(
>
> --------------------------------------------------------------------------
> Haifa Linux Club Mailing List (http://www.haifux.org)
> To unsub send an empty message to [EMAIL PROTECTED]
>
>


--------------------------------------------------------------------------
Haifa Linux Club Mailing List (http://www.haifux.org)
To unsub send an empty message to [EMAIL PROTECTED]


Reply via email to