Add -W warning option and fix the warnings it generates.