Revert "Revert "compilation: fix annoying and serious warnings (thanks faux123!)""

This reverts commit dcea95159fa328ec4fc55963cce127da352ad052.