Recently added typedef "string" is a horrid idea

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Recently added typedef "string" is a horrid idea
Date: 2016-02-06 22:11:07
Message-ID: 26503.1454796667@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I see that commit b47b4dbf6 added this to varlena.c:

typedef struct varlena string;

This is a remarkably bad idea. It will cause pgindent to do strange
things anywhere it sees a variable or field named "string", of which
we have quite a few. Remember that the effects of typedef names are
*global*, so far as pgindent is concerned; not only varlena.c will
be affected.

Please rename this typedef with some less-generic name. Probably
some of the other identifiers added in the same commit should be
adjusted to match.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-02-07 00:19:08 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Previous Message Tom Lane 2016-02-06 21:22:26 Re: Explanation for bug #13908: hash joins are badly broken