[Insight-developers] VNL Warning: Is there an equivalent to itkNotUsed?

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Tue Aug 16 13:12:51 EDT 2011


What about something like that:

#ifndef NDEBUG
  assert(...)
#endif

Jc

On Tue, Aug 16, 2011 at 11:58 AM, Sean McBride <sean at rogue-research.com>wrote:

> On Tue, 16 Aug 2011 15:54:33 +0000, Johnson, Hans J said:
>
> >I am trying to silence warnings from ITK for external tools.  I've
> >noticed this warning that should be quite easy to silence, but I don't
> >know the "vxl" compliant way to do it.
> >
> >Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_diag_matrix.h
> >
> >  //: get element with boundary checks.
> >  inline T get (unsigned r, unsigned c) const {
> >    assert(r == c); assert (r<size()); return diagonal_[r];
> >  }
> >
> >/scratch/johnsonhj/src/Slicer/Applications/CLI/DiffusionApplications/
> >ResampleDTI/ResampleDTI.cxx:1144:   instantiated from here
> >/scratch/johnsonhj/src/Slicer-git-itkv4/ITKv4/Modules/ThirdParty/VNL/src/
> >vxl/core/vnl/vnl_diag_matrix.h:106: warning: unused parameter ‘c’ [-
> >Wunused-parameter]
> >
> >Any recommendations on how to silence this?
>
> In my experience, the most portable way to silence that warning is to cast
> the expression to void, that is:
>
> (void)c;
>
> This works in C, C++, Objective-C, with gcc, icc, Visual Studio, clang, and
> CodeWarrior.
>
> Some people do this:
>
> c = c;
>
> But please don't, because clang will warn about an operation that does
> nothing. :)
>
> --
> ____________________________________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-developers
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110816/b0328893/attachment.htm>


More information about the Insight-developers mailing list