initdb: introduce PG_CMD_PRINTF intestead of PG_CMD_PRINTF{1,2,3}

Started by Alexander Kuleshovabout 10 years ago2 messageshackers
Jump to latest
#1Alexander Kuleshov
kuleshovmail@gmail.com

Hello all,

The src/bin/initdb/initdb.c provides three macros to write data to
cmdfd. All of these macro do the same, but with different amount of
arguments for fprintf().

Attached patch introduces PG_CMD_PRINTF macro which will take set of
variadic arguments via __VA_ARGS__ to replace the PG_CMD_PRINTF{1,2,3}
macros.

Any objections?

Attachments:

initdb-print.patchtext/x-patch; charset=US-ASCII; name=initdb-print.patchDownload+23-34
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alexander Kuleshov (#1)
Re: initdb: introduce PG_CMD_PRINTF intestead of PG_CMD_PRINTF{1,2,3}

Alexander Kuleshov <kuleshovmail@gmail.com> writes:

The src/bin/initdb/initdb.c provides three macros to write data to
cmdfd. All of these macro do the same, but with different amount of
arguments for fprintf().

Attached patch introduces PG_CMD_PRINTF macro which will take set of
variadic arguments via __VA_ARGS__ to replace the PG_CMD_PRINTF{1,2,3}
macros.

Any objections?

Yes. We do not accept patches that don't work on compilers without
__VA_ARGS__ (cf 7b077af50 for a recent example). At some point there
might be a reason that's compelling enough to make us move that
portability goalpost, but this hardly seems like such a reason.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers