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

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: C99 compliance for src/port/snprintf.c
Date: 2018-08-15 19:21:30
Message-ID: 5c0b98fc-a565-f418-74d8-ef1d42fa449f@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On 08/15/2018 03:18 PM, Tom Lane wrote:
>
> FWIW, the issue I've got with what C99 did is that you can narrow the
> *start* of the scope of a local variable easily, but not the *end* of
> its scope, which seems to me to be solving at most half of the problem.
> To solve the whole problem, you end up needing a nested block anyway.
>
> I do dearly miss the ability to easily limit the scope of a loop's
> control variable to just the loop, eg
>
> for (int i = 0; ...) { ... }
>
> But AFAIK that's C++ not C99.
>
>

Agree completely.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2018-08-15 19:22:10 Re: Code of Conduct plan
Previous Message Tom Lane 2018-08-15 19:18:57 Re: C99 compliance for src/port/snprintf.c

Browse pgsql-www by date

  From Date Subject
Next Message Stephen Frost 2018-08-15 19:22:10 Re: Code of Conduct plan
Previous Message Tom Lane 2018-08-15 19:18:57 Re: C99 compliance for src/port/snprintf.c