<div dir="ltr"><div>Sean,</div><div><br></div>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.<div><br></div>You are just imposing another constraint on programmers for what is a perfectly legal construct.<div><br></div><div>What warning level are you using? I don't think that I have seen this warning when building VTK.<div><br></div><div><div>As David Lonie says it does have its uses.</div><div><br></div><div>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. </div><div><br></div><div>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.</div><div><br></div><div>On a more general vein I deeply appreciate the effort you have put into cleaning up VTK over the past year or so. The code base is so much better thanks to your efforts.</div><div><br></div><div>What do others think?</div><div><br></div><div>Regards</div><div> Andrew</div><div><br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>---------- Forwarded message ----------<br>From: David Lonie <<a href="mailto:david.lonie@kitware.com">david.lonie@kitware.com</a>><br>To: Sean McBride <<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>><br>Cc: vtkdev <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>Date: Wed, 8 Apr 2015 09:49:23 -0400<br>Subject: Re: [vtk-developers] coding standards & switch case label accidental fallthrough<br><div dir="ltr">+1 for the change. The explicit token is great for readability and will be important as other compilers start warning about these.<div><br></div><div>-1 for forbidding them. A lot of times it just makes the most sense to use a fall through, as long as it's clearly labeled as intentional.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 7, 2015 at 1:49 PM, Sean McBride <span dir="ltr"><<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On Tue, 7 Apr 2015 13:42:51 -0400, David Cole said:<br>
<br>
>Is there really no way to refactor and simply eliminate all the<br>
>"intentional" fall throughs? It's a really nasty style to be allowing.<br>
>It should be discouraged in general.<br>
<br>
</span>I did refactor a few, but most I left because I was scared to touch or they were pretty elegant with fall-through. You can take a look:<br>
<<a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/59" target="_blank">https://gitlab.kitware.com/vtk/vtk/merge_requests/59</a>><br>
<br>
I'd be in favour of the coding standards saying something like "fall-through is discouraged, but when necessary must be annotated with VTK_FALLTHROUGH".<br>
<div><div><br>
Cheers,<br>
<br>
--<br>
____________________________________________________________<br>
Sean McBride, B. Eng <a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a><br>
Rogue Research <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
Mac Software Developer Montréal, Québec, Canada<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________</div>
</div></div></div></div></div>