[Insight-developers] ITK Dashboard : unused variable : 12 warnings

Bill Lorensen bill.lorensen at gmail.com
Mon Mar 16 11:01:17 EDT 2009


Luis,

I am attempting to eliminate this warning through the CTestCustom
file. I've asked Sean to modify his ctest script.

See below:

Sean,

On the itk builds Mac10.5-InsightBS-rel and Mac10.5-InsightBS-dbg can
you add this

CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}")

after

CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}")

Currently, these builds are not processing the CTestCustom.ctest file
is not being processed. This prevents compiler warning suppressions.

Thanks,

Bill


On Mon, Mar 16, 2009 at 4:23 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
> Hi Sean,
>
> The build from
>
>          RogeResearch5,
>          Mac10.5-InsightBS-rel
>
> Is reporting 12 warnings, all coming from
>
>
>    Insight/Utilities/vxl/core/vnl
>                         vnl_diag_matrix.h
>
> Line 81:
>
>
> 81: inline T& operator () (unsigned i, unsigned j) {
> 82:    assert(i == j);
> 83:    return diagonal_[i];
> 84:   }
>
>
> It would seem that in release mode, the "assert()"
> expression is not passed to the compiler.
>
> This is because the "assert()" macro is defined
> as empty when the flag "NDEBUG" is ON.
>
> The warning is innocuous in this case, so it
> seems reasonable to modify the code in order to
> silence the warning.
>
> One suggestion for silencing this warning is to
> replace line 81 with the following insert:
>
>
> 81: #ifdef NDEBUG
> 82: inline T& operator () (unsigned i, unsigned   ) {
> 83: #else
> 84: inline T& operator () (unsigned i, unsigned j ) {
> 85: #endif
>
>
> Do you see any drawback in making this replacement ?
>
>
> Given the small size of the method, another approach
> could be to put the two full versions of the method
> inside the #ifdef/#else/#endif block.
>
>
> Any suggestions ?
>
>
>
>    Thanks
>
>
>
>       Luis
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>


More information about the Insight-developers mailing list