[vtk-developers] warning for extra semicolon with vtkTypeMacro

Moreland, Kenneth kmorel at sandia.gov
Tue May 6 14:50:54 EDT 2014


As far as the vtkTypeMacro is concerned, I much prefer having the
semicolon after it. It grates on my nerve to see something that looks like
a statement not end in a semicolon and as Utkarsh brought up it wreaks
havoc on automatic indentation in editors.

My recommendation is to change the definition of vtkTypeMacro to swallow
the colon. You can do this by reconfiguring the definition so the last
statement is the typedef for Superclass without the colon.

-Ken



On 5/6/14 12:33 PM, "Sean McBride" <sean at rogue-research.com> wrote:

>On Tue, 6 May 2014 14:19:54 -0400, Andy Bauer said:
>
>>When using the GCC compilers with the -pedantic or the CUDA compilers
>>(probably others as well), there are a lot of warnings in VTK that there
>>is
>>an extra semicolon at the end of the vtkTypeMacro. I'm hoping to get rid
>>of
>>this warning but wanted to see if there are any good ideas on how to do
>>this beyond simple brute force. The main issue to me is that the macro is
>>defined in the header file so any codes that include the offending header
>>files will see this warning. There is potentially a bunch of them since
>>vtkObject.h itself has the unwanted semicolon in there.
>
>clang also gives that warning (with -Wextra-semi).  Personally, I'd like
>to see them fixed.  But there are very many places to change, and the
>cost/benefit is dubious.  Many changes are to macros in headers, as you
>said.  I'd experimented with using a regex to fix many of them at the
>same time, see here:
>
><http://review.source.kitware.com/#/c/13448/>
>
>I guess the first question is: do we want the ; in the macro or at the
>usage site?  ex:
>
><http://review.source.kitware.com/#/c/13448/1/Charts/Core/vtkChartLegend.c
>xx>
>
>Do we want
>
>vtkStandardNewMacro(vtkChartLegend);
>
>or
>
>vtkStandardNewMacro(vtkChartLegend)
>
>To me, the latter makes more sense...
>
>Cheers,
>
>-- 
>____________________________________________________________
>Sean McBride, B. Eng                 sean at rogue-research.com
>Rogue Research                        www.rogue-research.com
>Mac Software Developer              Montréal, Québec, Canada
>
>
>_______________________________________________
>Powered by www.kitware.com
>
>Visit other Kitware open-source projects at
>http://www.kitware.com/opensource/opensource.html
>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list