fix warnings emitted by clang

Ready to pull once it turns green.

The rest of the warnings I regard as noise and should be disabled using a command line switch.