Re: [HACKERS] pgindent

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Bernard Frankpitt <frankpit(at)pop(dot)dn(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] pgindent
Date: 1999-09-09 19:44:44
Message-ID: 199909091944.PAA01295@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Hi All,
>
> I just tried to get pgindent to work and I ran into a few snags
> }
> }
> ! if (*buf_ptr == 'L' || *buf_ptr == 'l')
> *e_token++ = *buf_ptr++;
> }

>
> while (1) {
> if (!(seensfx & 1) &&
> (*buf_ptr == 'U' || *buf_ptr == 'u')) {
> CHECK_SIZE_TOKEN;
> *e_token++ = *buf_ptr++;
> seensfx |= 1;

> Also, in the openbsd source the specials buffer is automatically
> resized, so it seems that neither part of the patch is necessary for
> recent openbsd sources.

Great. Your version looks nice. BSDI also has fixed the buffer size
problem, but it was easier to just send people a patch to apply, rather
than illegally sending out their changes.

>
> I think that you need to use
> indent --version -npro </dev/null >/dev/null 2>&1
>
> On my system (Redhat Linux 5.?) I get
>
> aims2-bernie:$ indent --version
> GNU indent 1.9.1
> aims2-bernie:$ echo $?
> 0
> aims2-bernie:$ bsdindent --version
> bsdindent: Command line: unknown parameter "--version"
> aims2-bernie:$ echo $?
> 1
>
> ( That is with 'bsdindent' as the patched freebsd indent )

Good. OK, new test is:

indent --version </dev/null >/dev/null 2>&1
if [ "$?" -eq 0 ]
then echo "You do not appear to have 'indent' installed on your
system." >&2
exit 1
fi

>
>
> 3)
>
> Finally, the result of running
>
> find . -name '*.[ch]' -type f -print | egrep -v '\+\+|/odbc/|s_lock.h'
> | xargs -n100 pgindent
>
> on a fresh copy of the 6.5 sources with either the openbsd or patched
> bsd indent is the following
>
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> ./backend/parser/gram.c
> Error(at)5251: #if stack overflow
> Error(at)5252: #if stack overflow
> Error(at)5263: Unmatched #endif
> Error(at)5264: Unmatched #endif

This is expected. Gram.c is generated from gram.y, so there is no real
need to indent it.

> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> Hope you installed /src/tools/pgindent/indent.bsd.patch.
> ./interfaces/ecpg/test/header_test.h
> Error(at)19: Stuff missing from end of file.

I haven't seen the egcs problem. In this case, it is getting confused
by the inline SQL commands. No cause for concern.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

  • pgindent at 1999-09-09 19:21:07 from Bernard Frankpitt

Browse pgsql-hackers by date

  From Date Subject
Next Message Edwin Ramirez 1999-09-09 20:52:25 Re: [HACKERS] Postgres Performance
Previous Message Michael Simms 1999-09-09 19:42:36 Re: [HACKERS] Vacuum analyze bug CAUGHT