Mostly enable support for checking format strings with -Wformat.

Basically derived from Ratbox 3.1.