[vtk-developers] Warning in VTK
Andy Cedilnik
Andy.Cedilnik at kitware.com
Thu Feb 21 13:04:41 EST 2002
At 12:05 PM 2/21/2002 -0500, Lisa Avila wrote:
>Berk,
>
>I like using assignments in conditionals too. I guess it is just not
>possible to have the compiler find the thinks you didn't mean ( like if (
>x = 3 ) {} ) but not the things you did mean. Are these warnings showing
>up on the dashboard? If so I vote for turning them off because I start to
>ignore warnings if they are there consistently. Only if we typically have
>no warning will people clean up warnings when they are introduced into the
>code.
Ok, gcc has the notion of assigning in conditional but you have to
let compiler know that. You do that by adding extra set of () around
it. For example:
if ( x = getnumber() )
{
}
would be changed to:
if ( ( x = getnumber() ) )
{
}
Visual c++ is not as smart.
So, should I throw the warning out?
Andy
More information about the vtk-developers
mailing list