Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Enabling more warnings?



What do folks think about turning on more gcc warnings and then changing
the code to eliminate them?  Adding -W to the CFLAGS generates a bunch
of "unused parameter" warnings, which we can either turn off with the
-Wno-unused-parameters option, or tweak in the code explicitly, like the
following:

#define UNUSED(x) x __attribute__((__unused__))
int
bin_set(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))

Or maybe this:

#define _U_ __attribute__((__unused__))
int
bin_set(char *nam, char **args, Options ops _U_, int func _U_)

I personally think that the UNUSED(x) one reads better than _U_, but I'm
not sure we want these sprinkled around in the code (rsync uses this
method, but we don't have nearly as many unused parameters as zsh does).

Thoughts?  The -W option turns up other warnings to fix as well, so I'm
also curious how people react to turning on -W by default.

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author