Skip to content
Snippets Groups Projects

WRG: fix warning on asserts

Merged 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

Merged by Gaëlle USSEGLIOGaëlle USSEGLIO 5 years ago (Jan 8, 2020 8:59am UTC)

Merge details

  • Changes merged into with 1b46a3ca.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading