[Insight-developers] Annoying Deprecation Warnings : Annoying but Necessary.

Brad King brad.king at kitware.com
Thu Dec 20 12:04:22 EST 2007


Luis Ibanez wrote:
> 
> Bill,
> 
> If the concern is the amount of warnings, you can enable in those builds
> the CMake variable:
> 
>                      ITK_LEGACY_SILENT
> 
> 
> We shouldn't remove the warnings, because that's how we alert users
> about the fact that this deprecated code is going to be removed in
> a future release.
> 
> These warnings are the early opportunity for users to stop using code
> that will disappear. If we remove the warnings, then users will be
> surprised when we actually remove the code, which is exactly the
> situation that the backward compatibility policy wants to avoid .
> 
> 
> My suggestion is that ITK_LEGACY_SILENT should be OFF by default,
> and that Dashboard machines should set it to ON.
> 
> In this way, users will get the warnings, but the Dashboard will
> not display them and will not be cluttered with them.

One possibility is that the dashboards be built with ITK_LEGACY_REMOVE.
 Then the deprecation stuff won't show up at all (and thus will not
warn), and we will know that no ITK examples use deprecated stuff.

On the other hand we probably want the deprecated stuff to still be
tested by the Testing directory.  It isn't possible to test deprecated
methods without calling them.  Therefore the individual tests (at least)
should be built with ITK_LEGACY_SILENT.  We should probably create tests
that are meant specifically to test the deprecated methods, and remove
calls to deprecated methods from other tests and examples.  Then we can
define a new macro like ITK_LEGACY_TEST at the top of the test's .cxx
file and setup itkMacro.h to interpret this as ITK_LEGACY_SILENT:

// testMyDeprecatedMethod.cxx
#define ITK_LEGACY_TEST
#include "itkClassWithDeprecatedMethod.h"
...

-Brad


More information about the Insight-developers mailing list