On 2/12/22 20:25, Even Rouault wrote:
Hopefully https://github.com/MapServer/MapServer/pull/6477 should fix that
to use or not to use assert(), and where, is one of the many debates for
which devs will have different opinions :
https://stackoverflow.com/questions/1081409/why-should-i-use-asserts .
I'd say assert() are supposed to be used for conditions you don't
anticipate to happen in practice and thus for which you don't have a
plan if they occur (a good reason is because you can't test it and thus
the error handling might be broken because untested). Of course practice
sometimes/often later contradicts your theories, as the impossible has a
trend to occur more often than you'd like :-)
assert() is unreliable as it is optimized out when using -DNDEBUG as set
by CMAKE_BUILD_TYPE=Release.
It is also a PITA for reproducible builds as it uses __FILE__ thereby
embedding the absolute path of the sources file in the binary.
Kind Regards,
Bas
--
GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146 50D1 6750 F10A E88D 4AF1
_______________________________________________
MapServer-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-dev