Re: C99 compliance for src/port/snprintf.c

From: David Steele <david(at)pgmasters(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: C99 compliance for src/port/snprintf.c
Date: 2018-08-15 18:03:16
Message-ID: 6ae46827-45de-b3e7-4f19-01f9c48b28d4@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On 8/15/18 12:17 PM, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)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(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-08-15 18:05:29 Re: C99 compliance for src/port/snprintf.c
Previous Message Alvaro Herrera 2018-08-15 17:35:56 Re: Documentaion fix.

Browse pgsql-www by date

  From Date Subject
Next Message Tom Lane 2018-08-15 18:05:29 Re: C99 compliance for src/port/snprintf.c
Previous Message Tom Lane 2018-08-15 17:05:39 Re: C99 compliance for src/port/snprintf.c