pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Steele <david@pgmasters.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: C99 compliance for src/port/snprintf.c
Date: Wed, 15 Aug 2018 15:57:43 -0400
Message-ID: <2069.1534363063@sss.pgh.pa.us> (raw)
In-Reply-To: <e452e970-cf80-6e7e-17c1-24730a5c9ca9@pgmasters.net>
References: <17245.1534289329@sss.pgh.pa.us>
	<CA+TgmoaanyYh9KG49yWdhzU72Ngh7XG5Gs9rtceQfBg6WFaybA@mail.gmail.com>
	<9456.1534347706@sss.pgh.pa.us>
	<20180815155237.pz5fgfmdo4cgqjta@alap3.anarazel.de>
	<CA+TgmoYvHzFkwChsamwbBrLNJRcRq+fyTwveFaN_YOWUsRnfpw@mail.gmail.com>
	<11138.1534349838@sss.pgh.pa.us>
	<dd48e765-9afe-4695-b2f4-f3cc0c1218e0@2ndQuadrant.com>
	<20825.1534360737@sss.pgh.pa.us>
	<e452e970-cf80-6e7e-17c1-24730a5c9ca9@pgmasters.net>

David Steele <david@pgmasters.net> writes:
> On 8/15/18 3:18 PM, Tom Lane wrote:
>> 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.

> This works in C99 -- and I'm a really big fan.

It does?  [ checks standard... ]  Oh wow:

       6.8.5  Iteration statements

       Syntax

               iteration-statement:
                       while ( expression ) statement
                       do statement while ( expression ) ;
                       for ( expr-opt ; expr-opt ; expr-opt ) statement
                       for ( declaration ; expr-opt ; expr-opt ) statement

I'd always thought this was only in C++.  This alone might be a sufficient
reason to drop C89 compiler support ...

			regards, tom lane




view thread (46+ messages)  latest in thread

Message-ID: <2069.1534363063@sss.pgh.pa.us>
Permalink:  ../2069.1534363063@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2069.1534363063@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david@pgmasters.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: C99 compliance for src/port/snprintf.c
  In-Reply-To: <2069.1534363063@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox