From: Wayne Davison <wayned@users.sourceforge.net>
To: zsh-workers@sunsite.dk
Subject: Enabling more warnings?
Date: Tue, 25 May 2004 12:22:54 -0700 [thread overview]
Message-ID: <20040525192254.GF7832@blorf.net> (raw)
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..
next reply other threads:[~2004-05-25 19:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-25 19:22 Wayne Davison [this message]
2004-05-25 19:57 ` Clint Adams
2004-05-25 20:18 ` Wayne Davison
2004-05-28 19:30 ` Wayne Davison
2004-05-26 13:48 ` Clint Adams
2004-05-26 14:04 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040525192254.GF7832@blorf.net \
--to=wayned@users.sourceforge.net \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).