[ITK] [ITK-dev] New clang warnings: reserved-id-macro

Sean McBride sean at rogue-research.com
Thu Dec 11 12:48:35 EST 2014


On Thu, 11 Dec 2014 12:32:49 -0500, Bradley Lowekamp said:

>I am seeing these new warnings on the dashboard from Mac10.8-clang-dbg-
>x86_64-static-torture:
>
>In file included from /Users/builder/external/ITK/Modules/Core/Common/
>src/itkHexahedronCellTopology.cxx:18:
>In file included from /Users/builder/external/ITK/Modules/Core/Common/
>include/itkHexahedronCellTopology.h:21:
>/Users/builder/external/ITK/Modules/Core/Common/include/itkMacro.h:39:9:
>warning: reserved identifier is used as macro name [-Wreserved-id-macro]
>#define __itkMacro_h
>
>Should this warning be disabled or do we need to invoke some sed
>wizardry to try to fix this?

Brad,

I was just writing about this, but you beat me to it. :)  The new warnings are because I updated clang on that machine to a newer svn trunk version (it's my bleeding edge machine).

C & C++ in fact reserve double underscores:

<http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier>

I'm turning the warning off to keep the dashboards clean, but ideally we should fix the warnings.

KWSys, CMake, VTK, and ITK all seem to have the same naming scheme for header guard #defines, namely "__<project><filename>_h", ex: __itkMacro_h, __vtkFooBar_h, etc.

Fixing this naming scheme would fix about 80% of the warnings.  I volunteer to make the changes, but we should agree on a scheme.  Maybe just drop the __ prefix would be enough.  Could throw another _ at the end too perhaps.

Thoughts?

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

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-developers


More information about the Community mailing list