discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C++?


From: Chris B. Vetter
Subject: Re: Objective-C++?
Date: Tue, 8 Apr 2003 08:52:38 -0700

On Tue, 08 Apr 2003 11:54:18 +0200
Helge Hess <helge.hess@skyrix.com> wrote:
> David Relson wrote:
> > For the most part I dislike C++, but it has one feature I'd really
> > like to have in Objective-C - the ability to declare variables
> > _anywhere_ it makes sense (not just at the start of a block).  One
> > particularly good place is loop variables, as in:
> > for (int i= 0; ...) {}
> Doesn't that work with the very recent gcc's ? I thought this was part
> of that new "C99" or something (updated ANSI-C) standard and
> implemented in gcc 3.??.

No, see Nicolas mail.

  int main(int argc, const char **argv, const char **envp)
  {
    for (int i = 0; i < 10; i++ )
      NSLog(@"foo: %d", i);
   
    exit(EXIT_SUCCESS);
  }

  :0> gmake
  main.m: In function `gnustep_base_user_main':
  main.m:87: error: `for' loop initial declaration used outside C99 mode

-- 
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]