pgsql: Fix non-C89-compatible coding in pgbench.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix non-C89-compatible coding in pgbench.
Date: 2014-05-19 04:07:01
Message-ID: E1WmEqr-0005EC-Jg@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix non-C89-compatible coding in pgbench.

C89 says that compound initializers may only contain constant expressions;
a restriction violated by commit 89d00cbe. While we've had no actual field
complaints about this, C89 is still the project standard, and it's not
saving all that much code to break compatibility here. So let's adhere to
the old restriction.

In passing, replace a bunch of hardwired constants "256" with
sizeof(target-variable), just because the latter is more readable and
less breakable. And const-ify where possible.

Back-patch to 9.3 where the nonportable code was added.

Andres Freund and Tom Lane

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/777d07d7a34f6af2a977297846a9ae133e727d9c

Modified Files
--------------
contrib/pgbench/pgbench.c | 62 ++++++++++++++++++++++++++-------------------
1 file changed, 36 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2014-05-19 04:35:40 pgsql: doc: 9.4 release note adjustements
Previous Message Bruce Momjian 2014-05-19 03:59:27 pgsql: doc: improve 9.4 release notes