Skip to content

WRG: fix warning on asserts

Cédric Traizet requested to merge fix_wrg into master

Fix warning created by the asserts in DiapOTB. This only affects the debug compilation mode, as assets are not compiled in release mode (at least when compiling diapotb inside the OTB)

This MR fix two types of warning :

  • comparison between signed and unsigned integers
  • testing the address of an object, e.g :
ImageKeywordlist sarImageKWL
assert(&sarImageKWL && "SAR Image Metadata don't exist.");

This assert is useless (it always evaluates to true), I removed all asserts on this kind (note that I left asserts on null pointers unchanged)

But maybe these asserts shouldn't be removed and should be replaced by something like :

ImageKeywordlist sarImageKWL
assert(!sarImageKWL.Empty() && "SAR Image Metadata don't exist.");

Is this what this assert is supposed to test ?

Merge request reports