bitcoin/bitcoin — pull request #1104 by laanwj (2012-04-15 11:52:40+00:00)
Title: Enable and fix most compilation warnings

This pull request enables most compilation warnings (of -Wall -Wextra) and fixes them. I compiled bitcoin-qt with g++ and clang to have as much warning coverage as possible. Warning flags in bitcoin-qt and bitcoind build have been equalized.

`char-subscripts` warnings were especially dangerous, as char can be negative, resulting in accesses outside the array and thus potential information leakage. Fixed this by adding (unsigned char).

I've left these warnings alone:

* `invalid-offsetof`: Looked this up, and found http://stackoverflow.com/questions/1129894/why-cant-you-use-offsetof-on-non-pod-strucutures-in-c
We use none of the special C++ multi-inheritance and dynamic casting so using `offsetof` should be safe.
* `sign-compare`: There's just too darn many of 'em. These could be worth checking later, as wrong signed-unsigned comparisons can result in nasty bugs.
* `unused-parameter`: Also way too many instances. And ignoring a parameter is no problem, usually.

I have carefully seperated this into commits for each separate warning class to make review easy.