pgindent and prototypes

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Cc: support(at)bsdi(dot)com
Subject: pgindent and prototypes
Date: 1998-08-09 04:49:48
Message-ID: 199808090449.AAA01661@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

BSD indent, and hence pgindent, has a problem identifying the difference
between function prototypes and functions when the prototype spans more
than line line, i.e.:

static
func(int x,
int y)

and

static
func(int x,
int y);

format the same, while the second should format as:

static func(int x,
int y);

I have talked to BSDI about the bug [BSDI-Support-Request #51998], and
though they have cheerfully fixed many of the other indent bugs, this
one it going to be much more difficult. I have looked at the code
myself, and it looks very complicated to fix.

I have decided to work around the bug by adding some awk code to
pgindent to fix the problem by finding potential function prototypes,
and changing the formatting into prototypes where appropriate.

Why is this important? Ctags, which is almost necessary with the 250k
lines of code in PostgreSQL, looks for the function name starting in
column 1. If a static function has a prototype, when you ctags into the
file, it ctags finds the prototype, and not the actual function.

I will run the new pgindent as part of the normal pre-beta release
process at the end of this month.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

Browse pgsql-hackers by date

  From Date Subject
Next Message Goran Thyni 1998-08-09 08:16:36 Re: thread-safe libpq and DBD::Pg
Previous Message Bruce Momjian 1998-08-09 03:50:55 Re: [HACKERS] thread-safe libpq and DBD::Pg