Beside the usual "Unused variable: xxxx", and the nice "Variable
'xxx' is assigned a value that is never used", I see an uncommon
class of suggestions, "The scope of the variable 'xxxxx' can be
reduced." that is simple but useful.
Bye,
bearophile

Thanks for posting this. I think these are worth correcting,
although in my quick scan I didn't see any actual bugs.

CppCheck is actually how I found the two bugs I fixed recently
(CtfeStack::maxStackPointer and ComplexExp::toChars). I spent a
couple hours going through the results of CppCheck but only found
those two actual problems (plus the third Globals thing that
turned out to not be a problem). That's not to say I thoroughly
investigated every item. There sure are a lot of unused
variables in DMD :P. I didn't feel qualified to submit a pull
request removing them as I don't have a very strong understanding
of DMD's source code yet.
One non-bug I thought about addressing but didn't end up doing
was this:
http://trass3r.github.com/dmd-cppcheck/18.html#line-4259
I looked up the file history and it seems like that's just a
result of Don doing some refactoring.
There are surprisingly few notices of memory leaks considering
DMD uses a GC.
Regards,
Brad Anderson

CppCheck is actually how I found the two bugs I fixed recently
(CtfeStack::maxStackPointer and ComplexExp::toChars). I spent a couple hours
going through the results of CppCheck but only found those two actual problems
(plus the third Globals thing that turned out to not be a problem). That's not
to say I thoroughly investigated every item. There sure are a lot of unused
variables in DMD :P. I didn't feel qualified to submit a pull request removing
them as I don't have a very strong understanding of DMD's source code yet.

I think in general fixing cppcheck's complaints makes the code more
understandable and maintainable, even if it doesn't actually fix anything.
A lot of the cruft in the code comes from the endless turmoil it undergoes :-)