[Insight-developers] Annoying warning from VNL

Johnson, Hans J hans-johnson at uiowa.edu
Sun Jan 5 20:29:30 EST 2014


This warning occurs in release mode builds on some compilers.  This is an
annoying warning that is easy to fix, but pushing it upstream to vml in
the vxl style of coding will take longer than I have time to address at
the moment.



ITKv4/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_diag_matrix.h:82:47:
warning:
      unused parameter 'j' [-Wunused-parameter]
  inline T& operator () (unsigned i, unsigned j) {


The quick robust but ugly way would be:

-    assert(i == j);
+    assert(i == j); (void)j;




==========
ITK way of doing it would be:

//The vxlDebugStatement is to be used to protect code that is only valid
in debug mode

#if defined( NDEBUG )
#  define vxlDebugStatement(x)
#else
#  define vxlDebugStatement(x) x
#endif
inline T& operator () (unsigned i, unsigned  itkDebugStatement(j) ) {




==========
Simple patchset sent to gerrit http://review.source.kitware.com/#/c/13966/
for critiques.   I would appreciate it if a vxl expert could push this
upstream.


Hans





________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list