Fix non-C89-compatible coding in pgbench.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 19 May 2014 04:06:28 +0000 (00:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 19 May 2014 04:06:28 +0000 (00:06 -0400)
commit777d07d7a34f6af2a977297846a9ae133e727d9c
treeb1c7bc5a34a3454dc422123762918c9e7a6a4307
parentd6a9767404cfee7f037a58e445b601af5837e4a5
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
contrib/pgbench/pgbench.c