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

From Tom Lane
Subject Re: C99 compliance for src/port/snprintf.c
Date
Msg-id 9877.1534371239@sss.pgh.pa.us
Whole thread Raw
In response to Re: C99 compliance for src/port/snprintf.c  (Andres Freund <andres@anarazel.de>)
Responses Re: C99 compliance for src/port/snprintf.c
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2018-08-15 15:57:43 -0400, Tom Lane wrote:
>> I'd always thought this was only in C++.  This alone might be a sufficient
>> reason to drop C89 compiler support ...

> It's also IIRC reasonably widely supported from before C99. So, for the
> sake of designated initializers, for loop scoping, snprintf, let's do
> this in master?

Nitpick: snprintf is an independent concern: that's from the C library,
not from the compiler.  To drive the point home, I could still test
master on "gaur" if I were to install a just-slightly-newer gcc on that
machine (its existing gcc installation isn't native either...); but
replacing its libc is a nonstarter.

Experimenting here says that even reasonably modern gcc's won't take
declarations-inside-for without "--std=c99" or such.  No idea about
other compilers.  So we'd have a little bit of work to do on
configuration before we could open the floodgates on this.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Stored procedures and out parameters
Next
From: Tom Lane
Date:
Subject: Re: C99 compliance for src/port/snprintf.c