This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [OT] Identifying unused include directives?


> What is "unneeded"?  On some systems, some header files pull in
> others, and are therefore unnecessary from a GCC perspective, but they
> are actually required to make the program portable.

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.

Yes, as you point out, in some cases, you want the #include present even
if this criterion of no semantic effect is met, but that's why this is a
warning, warnings always carry the danger of some false positives (or they
would not be warnings :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]