Re: Lessons from commit fest - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Lessons from commit fest
Date
Msg-id 1544.1208477456@sss.pgh.pa.us
Whole thread Raw
In response to Re: Lessons from commit fest  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Lessons from commit fest  (Aidan Van Dyk <aidan@highrise.ca>)
Re: Lessons from commit fest  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> That would certainly be better than the current approach, since
>> presumably it would cover not only Windows but the other
>> conditionally-compiled stuff that Bruce chooses not to compile on
>> his own machine.

> It would, as someone said, rock. But it wouldn't really address the ability of
> a developer to run pgindent on code he's about to send in, since it wouldn't
> have any typedefs that developer just created.

Well, that list is just a simple text file listing typedef names,
so it'd hardly be difficult to add your own to the list.

>> I still wish we could build the list directly from the source code,
>> but I have no suggestions for tools that would do it.

> If we wanted to do that I have a few questions:

> 1) I take it we feel safe guaranteeing that we won't use any fancy macros
>    inside typedefs. So no '#define pgtype(x) _pg_##x' or anythin like that.

Hmm ... we are fairly crawling with struct tags built that way:

/* Introduces a catalog's structure definition */
#define CATALOG(name,oid)    typedef struct CppConcat(FormData_,name)

but offhand I can't think of any actual typedef names built with ##.
Does indent need a preset list of struct tags?  Seems that would be
stupid ...

> 2) How much information do we need about the typedefs? Just their name?

Right.

> 3) How would this work with typedefs which come from system or library
>    includes?

Ouch, that's a real good point.  Maybe a certain amount of platform
dependence is inevitable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: DROP DATABASE vs patch to not remove files right away
Next
From: Tom Lane
Date:
Subject: Re: RFD: hexstring(n) data type