This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [OT] Identifying unused include directives?
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: dewar at gnat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 30 Aug 03 12:01:01 EDT
- Subject: Re: [OT] Identifying unused include directives?
I think the definition of unneeded is pretty clear. A reasonable definition
would be that the removal of the #include would not affect the semantics
of the resulting program. As I pointed out before, this is recursively
undecidable in the general case.
A way to avoid the undecidability, and that seems to be closer to what most
programmers would view as the intuitive meaning, would be that the removal of
the #include would not cause compilation errors or change the generated code.
Normally we think of #include as being part of the *static* semantics.