[vtk-developers] warning for extra semicolon with vtkTypeMacro

Ben Boeckel ben.boeckel at kitware.com
Tue May 6 15:08:38 EDT 2014


On Tue, May 06, 2014 at 14:38:26 -0400, Utkarsh Ayachit wrote:
> > Do we want
> > vtkStandardNewMacro(vtkChartLegend);
> > or
> > vtkStandardNewMacro(vtkChartLegend)
> > To me, the latter makes more sense...

I prefer the former in general (so the macro looks like a regular call;
but I also use all-upper for my macros when they're public so that
there's some indication funky things are going on), but for
block-generating code, leaving it out is sensible since blocks don't
always end with semicolons.

> I have always heard people prefer the latter, not entirely sure I know
> why. The only problem I have with the latter is that it messes up with
> my VIM indentation :). Does anyone know how to overcome that? I doubt
> VIM can ever know that it's a macro and hence the missing ";" is not
> really missing.

If you're willing to live with constantly updating ctags and having them
loaded all the time (I've found it's usually quite a problem for large
projects :( ), it can know it's a macro. Personally, I have backspace
dedent for me when Vim gets it wrong (which is often enough since the
CMake indentation rules in Vim are far from ideal).

--Ben



More information about the vtk-developers mailing list