Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fq1vW-0002sU-6g for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Aug 2018 19:57:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fq1vU-0005gE-5d for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Aug 2018 19:57:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fq1vT-0005g7-MD for pgsql-hackers@lists.postgresql.org; Wed, 15 Aug 2018 19:57:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fq1vM-0001PK-Ox for pgsql-hackers@lists.postgresql.org; Wed, 15 Aug 2018 19:57:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7FJvhg5002070; Wed, 15 Aug 2018 15:57:43 -0400 From: Tom Lane To: David Steele cc: pgsql-hackers@lists.postgresql.org Subject: Re: C99 compliance for src/port/snprintf.c In-reply-to: References: <17245.1534289329@sss.pgh.pa.us> <9456.1534347706@sss.pgh.pa.us> <20180815155237.pz5fgfmdo4cgqjta@alap3.anarazel.de> <11138.1534349838@sss.pgh.pa.us> <20825.1534360737@sss.pgh.pa.us> Comments: In-reply-to David Steele message dated "Wed, 15 Aug 2018 15:37:51 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2068.1534363063.1@sss.pgh.pa.us> Date: Wed, 15 Aug 2018 15:57:43 -0400 Message-ID: <2069.1534363063@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Steele 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