Re: src/tools/pginclude considered harmful (was Re: [PATCHES] - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: src/tools/pginclude considered harmful (was Re: [PATCHES]
Date
Msg-id 20060714203856.GA21675@svana.org
Whole thread Raw
In response to Re: src/tools/pginclude considered harmful (was Re: [PATCHES]  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: src/tools/pginclude considered harmful (was Re: [PATCHES]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jul 14, 2006 at 04:24:59PM -0400, Tom Lane wrote:
> After some reflection it seems that there is only one case where removal
> of a needed include file would not lead to a compiler error or warning,
> assuming gcc with ordinary -W settings (notably -Wmissing-prototypes).
> That case is exactly what Kris found: removal of a #define that is
> tested via #ifdef or #if defined().  (Can anyone think of other cases?)

My off-the-top-of-my-head solution would be a script that would pass
each file through "gcc -E" (the preprocessor), and compare before and
after rearrangement. You'd have to ignore the effects of included
header files, but it would pick up the cases where a block of code that
was previously included no longer is. Or if a macro is expanded
differently...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: src/tools/pginclude considered harmful (was Re:
Next
From: Tom Lane
Date:
Subject: Re: Three weeks left until feature freeze