The gcc mailing list post giving the original patch to add -Wformat-zero-length explains why it's there: this used to be a standard part of -Wformat and the patch submitter wanted to be able to turn it off without turning off all of -Wformat (for exactly the kind of reasons you give :-)). It's on by default because they didn't want to change
the default behaviour from gcc 2.95:
mnementh$ gcc-2.95 -Wall -c t.c
t.c: In function `main':
t.c:2: warning: zero-length format string
mnementh$ gcc-2.95 --version
2.95.4
and also because "There are lots of other checks for useless formats (e.g., for using useless combinations of flag characters where one gets ignored)".
(no subject)
Date: 2009-04-27 07:57 pm (UTC)and also because "There are lots of other checks for useless formats (e.g., for using useless combinations of flag characters where one gets ignored)".