[Paraview-developers] Problem in the ParaView code

Thompson, David C dcthomp at sandia.gov
Sat Sep 10 16:08:36 EDT 2005


> I found several places in the code where the following
> pattern repeats:
> for ( ... )
>   x = (tmp = fun(y)) * tmp;
> 
> I guess this really should be:
>
> for ( ... ) {
>   tmp = fun(y);
>   x = tmp * tmp;
> }
> Anyway, looks like gcc 4.0 does not understand that code either, so
> please make sure not to use this kind of construct.
> Also, could somebody fix this code in the following files:
> ParaView/Servers/Filters/vtkDataSetSubdivisionAlgorithm.cxx
> ParaView/Servers/Filters/vtkStreamingTessellator.cxx

OK, I've fixed those files... sorry, I thought I had caught all
of them but I guess I only got the ones in vtkSNL.

<grumble>It's a perfectly valid expression; since the assignment
is parenthesized, it must occur before the multiplication. And
the value of any assignment statement is the value assigned.
So gcc should know better than to emit a warning!</grumble>

     David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/mailman/private/paraview-developers/attachments/20050910/cc9879ca/attachment.html


More information about the Paraview-developers mailing list