Warning for a unused variable when complied in "Release"
Mantis Issue 1020, reported by lhermitte, assigned to jmichel, created: 2015-04-02
In otb::ogr::Feature::SetGeometryDirectly, the compiler says "g" is unused when compiled in Release Mode
Here attached a patch that solves the issue
1447150507 - julienPatch applied: https://git.orfeo-toolbox.org/otb.git/commitdiff/5e9df8923fbc2c049bd97c61066f5ce565b9e29d
1447323268 - gpaseroThis patch applies to OTB 3.16, not to version 5.0 :
The 'assert' have been replaced by 'itkAssertOrThrowMacro'. The variable 'g' is always used.
I'll revert the changes.
1447324626 - Luc HermitteDefensive Programming (i.e. throwing in release mode on programming errors) is a bad solution (1)
You should have used itkAssertInDebugAndIgnoreInReleaseMacro() instead.
(1) http://luchermitte.github.io/blog/2014/05/24/programmation-par-contrat-un-peu-de-theorie/ and http://luchermitte.github.io/blog/2014/05/28/programmation-par-contrat-les-assertions/
1447336341 - gpaseroThe macro itkAssertInDebugAndIgnoreInReleaseMacro() is almost equivalent to a plain assert(). It think I will apply your patch and switch back to plain assert. Any objection ?
1447338821 - julienGuillaume, I do not really understand what you mean by "apply your patch and sw