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

From David Steele
Subject Re: C99 compliance for src/port/snprintf.c
Date
Msg-id 6ae46827-45de-b3e7-4f19-01f9c48b28d4@pgmasters.net
Whole thread Raw
In response to Re: C99 compliance for src/port/snprintf.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: C99 compliance for src/port/snprintf.c
List pgsql-hackers
On 8/15/18 12:17 PM, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> 
>> Personally, I'd prefer to
>> continue avoiding // comments and intermingled declarations of
>> variables and code on grounds of style and readability.
> 
> ... which I agree with.

We already have -Wdeclaration-after-statement to prevent mixed
declarations.  Not sure what to do about comments except manual enforcement.

>> But it's kind
>> of difficult to believe that we really need to worry about people
>> still running 20-year old compilers very much.
> 
> Sure.  It's been a long time since anybody worried about those as
> optimization targets, for instance.  Still, I'm not in favor of
> actively breaking compatibility unless it buys us something.

We use C99 for the pgBackRest project and we've found designated
initializers, compound declarations, and especially variadic macros to
be very helpful.  Only the latter really provides new functionality but
simplifying and clarifying code is always a bonus.

So, +1 from me!

Regards,
-- 
-David
david@pgmasters.net


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Documentaion fix.
Next
From: Tom Lane
Date:
Subject: Re: C99 compliance for src/port/snprintf.c