RE: [GD-General] Variables scope
Brought to you by:
vexxed72
From: Anders N. <br...@ho...> - 2004-02-04 16:13:32
|
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önlund 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 simply > >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 |