Re: [hatari-devel] 68030 and movem

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


Hi,

now that you mention code analysis I am wondering whether the Hatari team has
considered using SonarQube for this. I have been using SonarQube for ages,
with different projects and different progamming languages, including C++.
For open source projects SonarCloud
(https://www.sonarsource.com/products/sonarcloud/) offers free hosting, also
for C/C++, which is not free in the SonarQube Community Edition.
With SonarQube/SonarCloud you do not only find subtle bugs, but really
learn a lot about how to correctly and efficiently use the programming
language of your choice.

Best regards

Uwe

> Hi,
> 
> I think it's considered good practice to always initialise variables
> these days.  Getting into that habit prevents you from having to worry
> about uninitialised memory reads.  We end up doing that at work to
> prevent static analysis tools from flagging it.  Reducing the scope of
> variables can prevent the need for pointless initialisation as well,
> i.e. don't declare the variable until you actually have a value for
> it.  The practice of declaring all variables at the top of a function
> dates back to ancient C compilers which mandated that.
> 
> Cheers,
> 
> Robin.
> 
> 
> On Mon, 18 Sept 2023 at 09:46, Andreas Grabher <andreas_g86@xxxxxxxxxx> wrote:
> 
> > That is likely. But why do we add code just to optimize it away afterwards? At least it is bad for readability.
> >
> 
> 



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