0.4 Clang compile warnings could lead to bugs

For all the help you need with Armagetron!
Post Reply
Monkey
Match Winner
Posts: 750
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

0.4 Clang compile warnings could lead to bugs

Post by Monkey »

As you guys probably know already, I compile my 0.4 client with LLVM/Clang. IMO, it generates better warnings than GCC, of which there is a lot. I'm not proficient enough in C++ to fix them all and I know that you guys are busy, however I recommend fixing the warnings (most are small issues) as this could, potentially, help with fixing bugs.
Playing since December 2006
User avatar
Z-Man
God & Project Admin
Posts: 11462
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: 0.4 Clang compile warnings could lead to bugs

Post by Z-Man »

Yeah, in active development, I'm a "no warnings tolerated" guy. I usually compile with warnings as errors. And since I'm also on clang on MacOS from time to time, those will get fixed eventually. The ones I have seen are easy to fix and sensible.

Edit: Oh! They're not all as harmless as I thought. It spots this:

Code: Select all

if(&*widget_ptr == 0)
Similar ones bit us hard when gcc decided that yeah, this would be undefined behavior if widget_ptr was null, which can't be, so widget_ptr can't be null, so this is always considered true. The code in the if block would not crash here, just do something wrong; spam warnings and leave the cockpit empty, looks like it.

I guess that is now my next job.
Monkey
Match Winner
Posts: 750
Joined: Thu May 22, 2008 12:36 am
Location: England, UK

Re: 0.4 Clang compile warnings could lead to bugs

Post by Monkey »

Good luck with it and, as always, thanks for putting in the time and effort!
Playing since December 2006
Post Reply