Re: The scope of a for statement

2010-03-13 Thread Magnus Fromreide
On Fri, 2010-03-05 at 15:07 -0800, Joe Buck wrote: > On Fri, Mar 05, 2010 at 02:40:44PM -0800, Magnus Fromreide wrote: > > On Fri, Mar 05, 2010 at 12:06:01PM -0800, Joe Buck wrote: > > > On Fri, Mar 05, 2010 at 11:38:23AM -0800, Magnus Fromreide wrote: > > > > Hello. > > > > > > > > I tried to do

Re: The scope of a for statement

2010-03-05 Thread Joe Buck
On Fri, Mar 05, 2010 at 02:40:44PM -0800, Magnus Fromreide wrote: > On Fri, Mar 05, 2010 at 12:06:01PM -0800, Joe Buck wrote: > > On Fri, Mar 05, 2010 at 11:38:23AM -0800, Magnus Fromreide wrote: > > > Hello. > > > > > > I tried to do > > > > > > for (;; ({ break; })) > > > printf("Hello\n"); >

Re: The scope of a for statement

2010-03-05 Thread Magnus Fromreide
On Fri, Mar 05, 2010 at 12:06:01PM -0800, Joe Buck wrote: > On Fri, Mar 05, 2010 at 11:38:23AM -0800, Magnus Fromreide wrote: > > Hello. > > > > I tried to do > > > > for (;; ({ break; })) > > printf("Hello\n"); > > > > and got an error message: > > > > error: break statement not within loo

Re: The scope of a for statement

2010-03-05 Thread Joe Buck
On Fri, Mar 05, 2010 at 11:38:23AM -0800, Magnus Fromreide wrote: > Hello. > > I tried to do > > for (;; ({ break; })) > printf("Hello\n"); > > and got an error message: > > error: break statement not within loop or switch But it only got through the parser, so that this error message co

The scope of a for statement

2010-03-05 Thread Magnus Fromreide
Hello. I tried to do for (;; ({ break; })) printf("Hello\n"); and got an error message: error: break statement not within loop or switch when compiling it as C. Given that 9899:1999 ยง6.8.6.3 says that a break statement only shall appear in or as a switch or loop body that is expected.