Topic: SV: Scope of vars declared in for


Author: "Bo Persson" <bop@malmo.mail.telia.com>
Date: 1999/08/01
Raw View

blargg <postmast.root.admi.gov@iname.com> skrev i
diskussionsgruppsmeddelandet:postmast.root.admi.gov-2907990511110001@aus-as5
-045.io.com...
> In article <MPG.12082c665fd2f721989c7f@news.mindspring.com>,
> jcoffin@taeus.com (Jerry Coffin) wrote:
>
> > In article <WgKQkdAzIjn3Ewss@robinton.demon.co.uk>,
> > francis@robinton.demon.co.uk says...
> >
> > [ ... ]
> >
> > > NO and this change to the language was made a long time ago (five or
> > > more years I think).  What is, to my mind, disgraceful is that, while
> > > VC++ does support the correct version if you use the appropriate
switch
> > > you will then find that MFC source is broken.
> > >
> > > It seems to me that you can either have MFC or Standard C++ but not
> > > both.
> >
> > It's actually FAR worse than that -- if only MFC broke when you used
> > the /Za switch, it wouldn't be so terrible.  Unfortunately, you can't
> > use (at least most of) the headers required by the standard unless you
> > enable MS's extensions.  IMO, that's a _dramatically_ worse situation.
>
> Essentially their compiler is even more academic than academic itself,
> when its "conforming" mode is on. It's so academic as to be almost
> completely unusable :-)  (I'm making playful jabs at academia here)
>

No, I think they are rather pragmatic in their effort to keep Windows
programs running.

The scoping rule *was* in the draft standard when the feature was
introduced. When the committee later changed its mind, the compiler *was*
changed too and the then old behaviour was simply moved to the "old
behaviour and MS extensions" section. Seems reasonable to me!


The problem for Windows programmers is that Windows and its corresponding
include files, like window.h, was written *long* before there were any
standards available. So now Windows 95 and a lot of production code are
using data structures that are not compliant with the 1998 C++ standard.

What to do? Easy - have the compiler enable "old behaviour and MS
extensions" by default!


It's way too late to recompile Windows 95 with a compliant compiler! :-)



Bo Persson
bop@malmo.mail.telia.com





[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]