Re: bloated heapam.h - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: bloated heapam.h
Date
Msg-id 20080512161350.GM5655@alvh.no-ip.org
Whole thread Raw
In response to Re: bloated heapam.h  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: bloated heapam.h
List pgsql-hackers
Zdenek Kotala wrote:
> Alvaro Herrera wrote:

>> (Digging further, it seems like bufpage.h should also include transam.h
>> in order to get TransactionIdIsNormal ... I start to wonder how many
>> problems of this nature we have on our headers.  Without having a way to
>> detect whether the defined macros are valid, it seems hard to check
>> programatically, however.)
>
> I attached script which should check it. In first step it runs C 
> preprocessor on each header (postgres.h is included as well). The output 
> from first step is processed again with preprocessor and define.h is 
> included. Define.h contains "all" used macros in following format:
>
> #define SIGABRT "NOT_EXPANDED_SIGABRT"
>
> Main problem is how to generate define.h. I used following magic:
>
> grep "^#define" `find . -name "*.h"` | cut -d" "  -f 2 | cut -f 1 | cut -f 1 -d"("
>
> but it generates some noise as well. Maybe some Perl or AWK magic should be better.

So were you able to detect anything bogus with this technique?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: bloated heapam.h
Next
From: Bruce Momjian
Date:
Subject: Re: Setting a pre-existing index as a primary key