Re: C99 compliance for src/port/snprintf.c - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: C99 compliance for src/port/snprintf.c
Date
Msg-id 20180815160740.GD3326@tamriel.snowman.net
Whole thread Raw
In response to Re: C99 compliance for src/port/snprintf.c  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq should append auth failures, not overwrite
Next
From: Andres Freund
Date:
Subject: Re: C99 compliance for src/port/snprintf.c