Re: Some particular lint problem (Danny Boulet)
Mon, 11 Jun 90 21:43:58 GMT

          From comp.compilers

Related articles
Some particular lint problem (1990-06-07)
Re: Some particular lint problem (1990-06-08)
Re: Some particular lint problem (1990-06-11)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Danny Boulet)
References: <>
Date: Mon, 11 Jun 90 21:43:58 GMT
Organization: Myrias Research Corporation
Keywords: C, lint

In article <> (Paulo Rosado) writes:
>I was given this medium-size system with about 15 *.c modules and respective
>*.h ones, to extend. The program was developed in an incremental not nicely
>way so _every_ c module includes _every_ h file. I want to rearrange this and
>define exactly what is defined/used by whom, at least, in order to get a
>better profit from the make utility.

The simplest way to determine if a ".c" file needs a particular ".h" file is
to try compiling the ".c" file without the ".h" file. It shouldn't be very
hard to build a checker that does this. For example, consider:

        #include <a.h>
        #include "b.h"
        #include <sys/d.h>

        funky() ...

The checker would delete "#include <a.h>" and invoke the C compiler sending
all output to /dev/null. If the exit code from the compile is zero then that
include file isn't needed. If it is non-zero, then it is. This process
would be repeated for each ".h" file.

If each file contains a lot of include files then this might take a while.
15 "c." and ".h" modules shouldn't take that long to process.

-Danny (kludge) Boulet :-)>
[Not very reliable, since undefined macros with arguments look just like
external functions that won't be determined to be missing until link
time. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.