|Re: [hatari-devel] fixing errors reported by GCC 10 -fanalyzer
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
On 5/11/20 4:13 PM, Nicolas Pomarède wrote:
Le 11/05/2020 à 14:56, Thomas Huth a écrit :
I think I'm with Eero here and rather would prefer to keep such
assert()s that check for logical errors (i.e. things that "should never
happen"). But we should really check for asserts that are used for
"normal" error handling, i.e. the where we use it for checking the
return value of malloc() and friends.
Ok ; but how to we handle the fact that assert are disabled at compile
time in release mode (or with whatever flags a linux distro might
supersedes the flags from hatari) ?
This means assert() will only be visible for developers or those
building in debug mode, but when Hatari is compiled for
mac/windows/linux distro the assert are no more there and we know that
many errors are reported by users, not by people doing the dev. These
people will mostly get a crash sooner or later due to memory corruption
and there will be no message to tell us what happened.
"Impossible things" shouldn't happen in Hatari's final releases if
they've been properly tested,
so I think it's OK to disable asserts for them
(although I would prefer them being enabled
But I strongly think that daily snapshot builds
and Hatari development versions should default to
building with asserts.
Thomas is defaulting to debugrelease target
instead of release target enough?