Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 17 Dec 2012 07:13:03 -0600 Message-ID: <50CF1A64.4F42@mindspring.com> Date: Mon, 17 Dec 2012 08:13:08 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) References: <0.480f47012449c190e37c.20121215140530GMT.87pq2be7h1.fsf@bsb.me.uk> <0.f76b8de9ae7050b6c96b.20121215204742GMT.87fw37doup.fsf@bsb.me.uk> <0.732b2ccaffb639498a0c.20121215221017GMT.87a9tfdl12.fsf@bsb.me.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 34 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.218.22 X-Trace: sv3-zR0H9PWleqXY+a4u5BeBK6JiCvdTqtQjn0o1W281ouoNp/0Z2zE6zoRaYnxGp/sdN5M2VNKTnbHI8xs!LODmQJpbW5H3bHmT30S5FZuH50LsdLk+4JiFSK1YSu5HYNylHx15w/kY3owGgCzSieLTJ0Ve66Mb!VHNNz8IVVg== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2345 Xref: csiph.com comp.lang.c:29398 Keith Thompson wrote: > So my interpretation of that is: > > void foo(void) { /* lifetime of i starts here */ > this(); > that(); > for (int i = 0 /* scope of i starts here */; i < 100; i ++) { > the_other_thing(i); > /* scope of i ends here */ > } > yet_another_thing(); > /* lifetime of i ends here */ > } > > The "block with which it [i] is associated" is the outer block for the > function, not the block that is the statement controlled by the for > loop. No. If you're going to say that there is one block with which (i) is associated, then it is the iteration statement itself, which is the block in which (i) is declared. N1570 6.8.5 Iteration statements 5 An iteration statement is a block ... In C90 "block" was synonymous with "compound statement". In C99, that was changed to the way that C11 has it now. -- pete