Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpyKo-0005dd-7U for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Aug 2018 16:07:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpyKm-0003Ca-LQ for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Aug 2018 16:07:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpyKm-0003CT-EV for pgsql-hackers@lists.postgresql.org; Wed, 15 Aug 2018 16:07:44 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpyKj-0008Ni-IH for pgsql-hackers@lists.postgresql.org; Wed, 15 Aug 2018 16:07:43 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 9A5B65F79C; Wed, 15 Aug 2018 12:07:40 -0400 (EDT) Date: Wed, 15 Aug 2018 12:07:40 -0400 From: Stephen Frost To: Andres Freund Cc: Tom Lane , Robert Haas , PostgreSQL Hackers Subject: Re: C99 compliance for src/port/snprintf.c Message-ID: <20180815160740.GD3326@tamriel.snowman.net> References: <17245.1534289329@sss.pgh.pa.us> <9456.1534347706@sss.pgh.pa.us> <20180815155237.pz5fgfmdo4cgqjta@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ha5BfBQxvLOsdLF5" Content-Disposition: inline In-Reply-To: <20180815155237.pz5fgfmdo4cgqjta@alap3.anarazel.de> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --ha5BfBQxvLOsdLF5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > We could just mandate C99, more generally. *cough* +1 *cough* > /me goes and hides in a bush. /me runs Thanks! Stephen --ha5BfBQxvLOsdLF5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJbdE/MAAoJEO1sijiDR2RVUZEP/0Dcl5DWT4KvfS5GztQN0TrO nuE2KZrRbfVxeLsCWc2Uzs1J+5oy7aHSRfbElGuXw6FcbbaLagNMH6YHK1ZfNKAZ 1dZpBbfdKIVquvZl+jbO4oi7E6T1VURBFtL/oeyaPCqkl0KtQVJ42zlCSObDTNsj ZeCYN8L/WviqyGkd1l/NCqiMESUN+nDnHtr+GVlSGSAfu7r5SMNK6lCq5bDS5Tmd B3llBzAoT60w3f0GCuXUqbsLpyoZRt7LBubeXdQ7nxGt9V9BK70E9OXNwcVTdthN R0E7AfAsHsi1Pfbo5ByAIN47TTxr4lzwwQ8syUl98Hwp7CQ6RSVoTcRkwqZ5BBEK Tl3f9gj7qIy7hvYHH3RQCAXDX4G5ILU5C60vehvXJ9cDbU9Py5xGt+SUdq24jeKM /F2GIuHzfi6Usp6rafoHA3NkA+Cwb3bK1c63GpaiYqgR/+38dPXtxIM6AF1v2ZGX fe0LV2zwxA2KpxweKRV5NWQaXIPSDXvLQ7IZwCVOLBRr9RAg/kXVlnqJa3hpPK5a MbJkQGZ9mvy1ysD+O/Bi8uh2lWfcsxhZXV7zqbOIdZbyuzDojrN2IBGErNiNU+bB EVELQJq2i+JZbV/G492zOq73CFH/4hkbJxzIrBDkSdhEo9V35wU45bKyhlDqvFxh 8KmS5WgaxttaakvftrLS =0inj -----END PGP SIGNATURE----- --ha5BfBQxvLOsdLF5--