Re: Recently added typedef "string" is a horrid idea

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Recently added typedef "string" is a horrid idea
Date: 2016-02-07 01:54:45
Message-ID: CA+TgmoZLHvCPDH8J36B_skNKdQsBg-rwtV-UR+6nRsFFzo2HzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 6, 2016 at 5:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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.

Oops. I didn't foresee that outcome. I'm not sure offhand what else
to call it, but I suppose we can come up with something.
"charactertype", maybe?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Filip Rembiałkowski 2016-02-07 02:42:59 Re: proposal: make NOTIFY list de-duplication optional
Previous Message Michael Paquier 2016-02-07 00:19:08 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby