From: Zack Weinberg <zack@codesourcery.com>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: gcc@gcc.gnu.org
Subject: Re: Unused macros warning?
Date: Tue, 23 Jul 2002 05:15:00 -0000 [thread overview]
Message-ID: <20020723055529.GC8141@codesourcery.com> (raw)
In-Reply-To: <20020722063352.GA22349@daikokuya.co.uk>
On Mon, Jul 22, 2002 at 07:33:52AM +0100, Neil Booth wrote:
> I made a local modification to cpplib so that, if -Wunused, it reports
> all macros defined in the main file that are unused, or unused before
> being #undef-ed.
>
> Might this be a useful addition to mainline? It shouldn't be in -Wall,
> as it involves a slightly expensive hashtable walk at the end of
> preprocessing which most users wouldn't want to pay for, but could
> be enabled with the front ends' -Wunused, say.
Yes, I think this would be useful, as long as it doesn't ding you for
macros in headers.
> Long-term, it would be nice if cpplib could tell you if any header you
> include is not used for any purpose. The kernel guys have wanted this
> feature for a long time.
Oooh, I want this.
> I think it's not too hard, once the front end uses logical lines
> internally; it then just becomes a matter of reporting a line as
> "used" when something from it (like a macro, struct, typedef etc.)
> is used, and letting cpplib use the line maps to convert that to
> file usage, and doing a quick pass over the linemap structures at
> the end of preprocessing.
Sounds plausible.
zw
next prev parent reply other threads:[~2002-07-23 5:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-22 5:22 Neil Booth
2002-07-22 13:03 ` Paul Koning
2002-07-23 5:15 ` Zack Weinberg [this message]
2002-07-23 22:31 ` David O'Brien
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=20020723055529.GC8141@codesourcery.com \
--to=zack@codesourcery.com \
--cc=gcc@gcc.gnu.org \
--cc=neil@daikokuya.co.uk \
/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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).