From: Stephen Frost <sfrost@snowman.net>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: C99 compliance for src/port/snprintf.c
Date: Wed, 15 Aug 2018 12:07:40 -0400
Message-ID: <20180815160740.GD3326@tamriel.snowman.net> (raw)
In-Reply-To: <20180815155237.pz5fgfmdo4cgqjta@alap3.anarazel.de>
References: <17245.1534289329@sss.pgh.pa.us>
<CA+TgmoaanyYh9KG49yWdhzU72Ngh7XG5Gs9rtceQfBg6WFaybA@mail.gmail.com>
<9456.1534347706@sss.pgh.pa.us>
<20180815155237.pz5fgfmdo4cgqjta@alap3.anarazel.de>
Greetings,
* Andres Freund (andres@anarazel.de) wrote:
> On 2018-08-15 11:41:46 -0400, Tom Lane wrote:
> > BTW, independently of whether to back-patch, it strikes me that what
> > we ought to do in HEAD (after applying this) is to just assume we have
> > C99-compliant behavior, and rip out the baroque logic in psnprintf
> > and appendPQExpBufferVA that tries to deal with pre-C99 snprintf.
> > I don't expect that'd save any really meaningful number of cycles,
> > but at least it'd buy back the two added instructions mentioned above.
> > I suppose we could put in a configure check that verifies whether
> > the system snprintf returns the right value for overrun cases, though
> > it's hard to believe there are any platforms that pass the 'z' check
> > and would fail this one.
>
> We could just mandate C99, more generally.
*cough* +1 *cough*
> /me goes and hides in a bush.
/me runs
Thanks!
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../20180815160740.GD3326@tamriel.snowman.net/2-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sfrost@snowman.net, andres@anarazel.de, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: C99 compliance for src/port/snprintf.c
In-Reply-To: <20180815160740.GD3326@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox