Re: [hatari-devel] fixing errors reported by GCC 10 -fanalyzer

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Mon, 11 May 2020 18:05:17 +0300
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:

> Hi,
> 
> 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

I agree, for the release tarballs, I think it's ok if the asserts are
disabled there. For the Linux distros, I think we should simply leave
the decision to the package maintainer - they should configure the
build in their spec file as desired.

> But I strongly think that daily snapshot builds
> and Hatari development versions should default to
> building with asserts.

Right. I've enabled the Debug build type now for most of the CI
pipelines.

> Thomas is defaulting to debugrelease target
> instead of release target enough?

What's the debugrelease target? I can't find any cmake documentation
about that...? Running "cmake -DCMAKE_BUILD_TYPE:STRING=debugrelease ."
simply seems to compile without any CFLAGS at all, so this build type
does not seem to exist?

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/