[Insight-developers] Change in ITK[master]: COMP: Removed C++0x construct to silence warning

Hans Johnson hans-johnson at uiowa.edu
Thu Dec 23 09:45:24 EST 2010


Brad,

1) Adding the global warnings to errors flag would cause many difficulties
(See item 3 for alternative option).  Clang is finding a lot of minor (real,
but minor) coding lapses.  For instance unused variables would now cause
compiler failures.  This is problematic for the Utilities directory where it
takes a long time to remove those warnings.

2)  There is a flag in clang for allowing support of C++0x, and we can turn
that on to remove the warning.  I just thought it is interesting that we
have been taking advantage of C++0x constructs for many years without even
noticing it!

3) This was my quick attempt at removing 1000's of warnings.  After reading
your recommendation, I do think that a targeted clang compiler modification
in the main ITK CMakeLists.txt file would work (Similar to the
template-depth flags for the gcc compiler).  There are several ways we can
go:  a)  silence this warning, and compile the code with this feature used,
b) turn just this warning into an error at configuration (it will pass
because the Cmake try/compile will fail).

Please let me know what you think is the best option.

Hans



On 12/23/10 8:12 AM, "Arnaud Gelas (Code Review)"
<gerrit2 at public.kitware.com> wrote:

> Bradley Lowekamp has posted comments on this change.
> 
> Change subject: COMP:  Removed C++0x construct to silence warning
> ......................................................................
> 
> 
> Patch Set 1:
> 
> I am not sure what I think of this change. The compiler is able to build this
> code in the try_compile, and the compiler option is specifically asking for
> warning like this. The in-class initialization can be superior to the external
> initialization due to possible inlining optimizations. So we have a bit of a
> mixed bag.
> 
> Is there a CMake, or clang flag to treat compiler warnings as errors? Adding
> that to this try compile may be the best solution.
> 
> --
> To view, visit http://review.source.kitware.com/611
> To unsubscribe, visit http://review.source.kitware.com/settings
> 
> Gerrit-MessageType: comment
> Gerrit-Change-Id: I5fd89944929990359b8f4979fc8833d22edc67f6
> Gerrit-PatchSet: 1
> Gerrit-Project: ITK
> Gerrit-Branch: master
> Gerrit-Owner: Hans J. Johnson <hans-johnson at uiowa.edu>
> Gerrit-Reviewer: Bradley Lowekamp <blowekamp at mail.nih.gov>

-- 
Hans J. Johnson, Ph.D.
Assistant Professor
200 Hawkins Drive
T205 BT, The University of Iowa
Iowa City, IA 52242

hans-johnson at uiowa.edu
PHONE: 319 353 8587



More information about the Insight-developers mailing list