[vtk-developers] coding standards & switch case label accidental fallthrough

Sean McBride sean at rogue-research.com
Tue Apr 14 19:08:49 EDT 2015


On Thu, 9 Apr 2015 07:59:27 +1000, Andrew Maclean said:

>I don't see the need for introducing yet another VTK_ macro for what is a
>rare and perfectly legal code construct that is picked up as a warning by
>one compiler type.
>
>You are just imposing another constraint on programmers for what is a
>perfectly legal construct.
>
>What warning level are you using? I don't think that I have seen this
>warning when building VTK.
>
>As David Lonie says it does have its uses.
>
>Even when looking at Common/DataModel/vtkHyperTreeGrid.cxx in your link
>below I think it is easier to read and understand without the added macro
>(line 1108 onwards). Similarly in a few of the other ones
>e.g. vtkImageMapToColors.cxx, vtkImageInterpolator.cxx that you have there.
>
>Having said this I am amazed at the number of missing break statements that
>you have found. It is a wonder some of this code ever worked! So the
>warning is good in that respect.
>
>What do others think?

Andrew,

As the only one that half-objected, do you -2 the change?  Otherwise, I'll merge it tomorrow...

<https://gitlab.kitware.com/vtk/vtk/merge_requests/59>

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the vtk-developers mailing list