Topic: List of C++ Incompatibilities
Author: Christopher Eltschka <celtschk@physik.tu-muenchen.de>
Date: 1999/08/27 Raw View
Ronny wrote:
[...]
> http://fusshuhn.ourfamily.com/cppincomp.html
>
> Of course I am not a language lawyer and I guess that my list is
> incomplete
> and erroneous. Before announcing it to a broader audience, I therefore
> ask in
> this forum for some volunteers to have a look at this list and mail
> and/or
> post comments, which I will try to incorporate.
>
> Thanks a lot for your cooperation,
One point I see at the top of your page is that you
link the words "Ansi C++ Standard" to a CD2. Now of course this
is the latest which is available on the Web, but you should
say that what you are linking to is _not_ the final standard,
but an earlier draft. There are several changes between those
documents (f.ex. the auto_ptr definition got changed quite
a lot), so it's important to distinguish those.
Also, "DWP" is short for "Draft Working Paper", which is
consistant with what you link, but not with what you write.
Another error is in the "Access to entities in standard
library headers" section.
The C standard names, as gotten from the <cxxx> headers are
only in namespace std, unless they are macros. You can get
them in the global namespace as well by including the <xxx.h>
version; however, this is deprecated. So:
#include <cstdlib>
int main()
{
exit(1); // Error: exit only in namespace std
return EXIT_SUCCESS; // Ok: EXIT_SUCCESS is a macro
}
but:
#include <stdlib.h> // but this is deprecated
int main()
{
exit(1); // Ok: Now it's in the global namespace
std::exit(2); // AFAIK also Ok.
}
[ 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 ]
Author: David R Tribble <david@tribble.com>
Date: 1999/08/25 Raw View
Ronny <ronald_f@my-deja.com> wrote:
> I tried to find on the Web some information regarding these
> incompatibilities, but did not find a single place where all these
> are put together.
I'm currently writing an HTML document that will list the
incompatibilities between C90 and C++98, and between C9X and C++98.
It's not finished yet, but you can comment on it anyway:
http://david.tribble.com/text/cdiffs.htm
-- David R. Tribble, david@tribble.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 ]
Author: "James Kuyper Jr." <kuyper@wizard.net>
Date: 1999/08/26 Raw View
David R Tribble wrote:
>
> Ronny <ronald_f@my-deja.com> wrote:
> > I tried to find on the Web some information regarding these
> > incompatibilities, but did not find a single place where all these
> > are put together.
>
> I'm currently writing an HTML document that will list the
> incompatibilities between C90 and C++98, and between C9X and C++98.
>
> It's not finished yet, but you can comment on it anyway:
> http://david.tribble.com/text/cdiffs.htm
You've missed a few of the incompatibilities between C89 and C++, that
have been removed by C9X. Specifically:
// comments - these are in fact used extensively in the C9X code
examples.
declaration of variables in the initialization part of a for()
statement.
intermixed declarations and statements
[ 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 ]
Author: Oleg Zabluda <zabluda@math.psu.edu>
Date: 1999/08/26 Raw View
James.Kanze@dresdner-bank.com wrote:
: In article <37B2E1B7.2C5F@wanadoo.fr>,
: Valentin Bonnard <Bonnard.V@wanadoo.fr> wrote:
:> The ARM says that all templates are exported; this is
:> hardly a problem in practice because, except cfront,
:> no compiler ever implemented that.
: Really. Except for g++,
Try --repo command-line option.
: I've never found a Unix compiler which didn't
: implement it, or at least simulate it.
Oleg.
--
Life is a sexually transmitted, 100% lethal disease.
[ 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 ]
Author: James.Kanze@dresdner-bank.com
Date: 1999/08/23 Raw View
In article <37B2E1B7.2C5F@wanadoo.fr>,
Valentin Bonnard <Bonnard.V@wanadoo.fr> wrote:
> The ARM says that all templates are exported; this is
> hardly a problem in practice because, except cfront,
> no compiler ever implemented that.
Really. Except for g++, I've never found a Unix compiler which didn't
implement it, or at least simulate it. (I wonder what the old Lucid
compiler did -- I never got a chance to use it, but I think that they
were the second compiler to implement templates, after CFront.)
--
James Kanze mailto: James.Kanze@dresdner-bank.com
Conseils en informatique orientie objet/
Beratung in objekt orientierter Datenverarbeitung
Ziegelh|ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ 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 ]
Author: Valentin Bonnard <Bonnard.V@wanadoo.fr>
Date: 1999/08/19 Raw View
zeisel@my-deja.com wrote:
>
> In article <7ou5li$qfp$1@nnrp1.deja.com>,
> Ronny <ronald_f@my-deja.com> wrote:
> > I tried to find on the Web some information regarding these
> > incompatibilities,
> > but did not find a single place where all these are put together.
>
> Did you check
>
> http://www.research.att.com/~bs/3rd_compat.(ps|pdf)
I don't see anything about porting from the ARM to
standard C++. It's mostly about C and coping with
pre-standard C++.
--
Valentin Bonnard
---
[ 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 ]
Author: Francis Glassborow <francis@robinton.demon.co.uk>
Date: 1999/08/20 Raw View
In article <37BC2070.103C@wanadoo.fr>, Valentin Bonnard
<Bonnard.V@wanadoo.fr> writes
>I don't see anything about porting from the ARM to
>standard C++. It's mostly about C and coping with
>pre-standard C++.
Isn't the ARM pre-standard C++? :)
Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
[ 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 ]
Author: Valentin Bonnard <Bonnard.V@wanadoo.fr>
Date: 1999/08/20 Raw View
Francis Glassborow wrote:
>
> In article <37BC2070.103C@wanadoo.fr>, Valentin Bonnard
> <Bonnard.V@wanadoo.fr> writes
> >I don't see anything about porting from the ARM to
> >standard C++. It's mostly about C and coping with
> >pre-standard C++ [compilers].
>
> Isn't the ARM pre-standard C++? :)
It is. So ?
--
Valentin Bonnard
[ 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 ]
Author: zeisel@my-deja.com
Date: 1999/08/16 Raw View
In article <7ou5li$qfp$1@nnrp1.deja.com>,
Ronny <ronald_f@my-deja.com> wrote:
> The C++ ANSI standard brought not only a lot of new features, but
also
> a few
> incompatibilities with respect to current practice (a.k.a. "ARM").
>
> I tried to find on the Web some information regarding these
> incompatibilities,
> but did not find a single place where all these are put together.
Did you check
http://www.research.att.com/~bs/3rd_compat.ps
or
http://www.research.att.com/~bs/3rd_compat.pdf ?
Helmut
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
[ 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 ]
Author: Valentin Bonnard <Bonnard.V@wanadoo.fr>
Date: 1999/08/12 Raw View
[ Sent by mail too ]
Ronny wrote:
> The C++ ANSI standard brought not only a lot of new features, but also
> a few
> incompatibilities with respect to current practice (a.k.a. "ARM"). This
> means
> that long-time C++ programmers could unknowingly write code that would
> either
> not compiler under ANSI ruling, or exhibit different behaviour.
>
> I tried to find on the Web some information regarding these
> incompatibilities,
> but did not find a single place where all these are put together. Since
> such
> an overview could be very helpful for programmers shifting to ANSI C++,
> I
> tried to compile this list myself and make it publicly available. It can
> be
> found on
>
> http://fusshuhn.ourfamily.com/cppincomp.html
First, C++ headers with .h extention were part of the
``current practice'' but were never ``standard''.
I practice, I think that most problems when changing
from ARM to standard code are with templates, and new.
The ARM says that all templates are exported; this is
hardly a problem in practice because, except cfront,
no compiler ever implemented that.
With the ARM, templates are parsed only at instanciation
time; now there is the need for:
- explicit qualification Base<T>::i in the scope Derived<T>
- the typename keyword
This last one will cause quite a few compiler errors.
inlines at file scope were static by default (unless
declared extern), they now have global linkage (unless
declared static). inline member functions had and always
have global linkage.
The overloading rules also changed.
--
Valentin Bonnard
[ 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 ]
Author: wmm@fastdial.net
Date: 1999/08/13 Raw View
In a previous article, Ronny <ronald_f@my-deja.com> writes:
> The C++ ANSI standard brought not only a lot of new features, but also
>a few
>incompatibilities with respect to current practice (a.k.a. "ARM").
..
>I
>tried to compile this list myself and make it publicly available. It can
>be
>found on
>
> http://fusshuhn.ourfamily.com/cppincomp.html
>
>Of course I am not a language lawyer and I guess that my list is
>incomplete
>and erroneous. Before announcing it to a broader audience, I therefore
>ask in
>this forum for some volunteers to have a look at this list and mail
>and/or
>post comments, which I will try to incorporate.
One thing that comes immediately to mind is the non-injection of friend
declarations into the containing scope.
There are also some pretty subtle changes in overload resolution.
-- wmm
----- Posted via NewsOne.Net: Free Usenet News via the Web -----
----- http://newsone.net/ -- Discussions on every subject. -----
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
---
[ 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 ]
Author: Ronny <ronald_f@my-deja.com>
Date: 1999/08/13 Raw View
Thank you very much for your comments!
Valentin wrote:
> First, C++ headers with .h extention were part of the
> ``current practice'' but were never ``standard''.
Yes, you are right, and now where I think about it: There existed a DOS
compiler - was it Borland? - who insisted on a *.hpp extension.
> I practice, I think that most problems when changing
> from ARM to standard code are with templates, and new.
And if you say templates, you will probably also say exceptions. The
reason why I left out template and exception issues altogether, was,
that there where a lot of compiler differences in the way these features
where supported (after all, Stroustrup regarded these still as
"experimental features"), so I believe there is no danger that a
programmer would unwittingly run in an incompatibility problem.
Nevertheless, if I get enough requests to include incompatibilities
between the way templates are defined in the ARM, and in the way the
standard does, I will include these topics on my page. But since I have
only a very basic experience with templates and exceptions (to remain
compatible across platforms, I always used only very simple forms), I
would need additional input (similar to the way Valentin did) from other
volunteers of what exactly to include.
Ronald
--
Ronald Fischer <ronald_f@my-deja.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
[ 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 ]
Author: Ronny <ronald_f@my-deja.com>
Date: 1999/08/12 Raw View
The C++ ANSI standard brought not only a lot of new features, but also
a few
incompatibilities with respect to current practice (a.k.a. "ARM"). This
means
that long-time C++ programmers could unknowingly write code that would
either
not compiler under ANSI ruling, or exhibit different behaviour.
I tried to find on the Web some information regarding these
incompatibilities,
but did not find a single place where all these are put together. Since
such
an overview could be very helpful for programmers shifting to ANSI C++,
I
tried to compile this list myself and make it publicly available. It can
be
found on
http://fusshuhn.ourfamily.com/cppincomp.html
Of course I am not a language lawyer and I guess that my list is
incomplete
and erroneous. Before announcing it to a broader audience, I therefore
ask in
this forum for some volunteers to have a look at this list and mail
and/or
post comments, which I will try to incorporate.
Thanks a lot for your cooperation,
Ronald Fischer
--
Ronald Fischer <ronald_f@my-deja.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ 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 ]