Enhancement patch for cpp

Zack Weinberg zack@rabi.columbia.edu
Wed Jan 20 09:08:00 GMT 1999


On 20 Jan 1999 13:17:14 +0100, Ben Elliston wrote:
>zack@rabi.columbia.edu (Zack Weinberg) writes:
>
>> I meant that the warnings are repeated for each compiler invocation.
>> For even a small number of source (.c) files in a package, that would
>> get annoying fast.
>
>So does compiling applications that use /usr/include/X11 when the
>function prototypes assume the `int' return type!  Nevertheless, the
>warnings are correct.
>
>The problem I had with adding a `-Wmissing-include-dirs' flag was that 
>the warning is most sensibly issued as the -I arguments are process.
>Unless the -W warning option is used before the -I options on the
>command line, the warning will not fire.
>
>Without adding explicit code to walk through the include search path
>*after* argument processing, adding a -W switch seems
>unworkable. Suggestions?

Well, actually cpplib does have code to walk the include search path
after argument processing - look at merge_include_chains in
cppfiles.c.  I was planning to make that function do most of what
append_include_chain does now anyway, it would be easy to hook the -W
option in there too.

zw



More information about the Gcc-patches mailing list