Re: [GD-General] Variables scope
Brought to you by:
vexxed72
From: <ke...@ac...> - 2004-02-04 17:38:59
|
In 7.0 and up you can change the behaviour of for loops without affecting the other "extensions", there is a separate setting for it. It's not anonymous unions that are disabled with language extensions off though, but anonymous structs. Anonymous unions is valid ANSI C, I'm pret= ty sure. // Kristoffer ----- Original Message -----=20 From: "Anders Nilsson" <br...@ho...> To: <gam...@li...> Sent: Wednesday, February 04, 2004 5:15 PM Subject: RE: [GD-General] Variables scope > This is not really a bug but rather a feature so service packs are not > likely to change the behaviour. You can turn on "more" compliance with > the C++-standard but then you get other things you might not want > (anonymous unions are forbidden etc). The behavior of a language should > not change with SP's (but optional features can be added though). > > Just use the define-hack and include it in some file that all files > includes (typedefs.h or something) and then you can include it on the > platforms that has the "broken" variable scopes). > > Anders Nilsson > > On Wed, 2004-02-04 at 15:09, CAVEY GERARD wrote: > > >Kristoffer Gr=C3=B6nlund wrote: > > > > > >>The way I've worked around this in the past has been by redefining = for as > > >>follows: > > >>#define for if (false) {} else for > > >> > > >>Yes, it's a hideously ugly hack, but so is the problem in the first place. > > >>I've never had any problems because of it. > > >> > > >> > > >Hmm... sounds like an ugly solution for something that is more simpl= y > > >solved by just > > >declaring the loop counter outside the for. > > > > Hi > > As Mr Aravelo(pyrostudios) told me out of list > > it can also be written > > #define for if (1) for > > a bit simpler ... > > I didn t update VC 6.0 yet but maybe that the latest service pack > > can avoid the workaround. > > Anyway I d better wait to get VS.NET > > Thanks for your help > > > > Regards > > GC > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D557 |