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 usingoffsetofshould 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.