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

From Andrew Dunstan
Subject Re: C99 compliance for src/port/snprintf.c
Date
Msg-id 5c0b98fc-a565-f418-74d8-ef1d42fa449f@2ndQuadrant.com
Whole thread Raw
In response to Re: C99 compliance for src/port/snprintf.c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: C99 compliance for src/port/snprintf.c
Next
From: David Steele
Date:
Subject: Re: C99 compliance for src/port/snprintf.c