[vtk-developers] warning for extra semicolon with vtkTypeMacro
Sean McBride
sean at rogue-research.com
Tue May 6 14:33:59 EDT 2014
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.cxx>
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
More information about the vtk-developers
mailing list