Discussion:
Ansi C++ and Borland C++?
(too old to reply)
Rory Walsh
2003-09-12 08:32:23 UTC
Permalink
Hi can anyone explain to me the main difference between Ansi C++ and Borland
C++? I have a library that was written in Ansi C++ and ports to all major
platforms, windows icluded, however when I build the library in Borland C++
Builder and try to compile an application with it my app does not respond in
the way it should with this particular library? So can anyone explain the
major differences between the two standards in cae thats where the problem
might be? Thanks in advance.

Rory.
Frank Birbacher
2003-09-12 09:03:21 UTC
Permalink
Hi!
Post by Rory Walsh
Hi can anyone explain to me the main difference between Ansi C++ and Borland
C++?
FWIK: Ansi C++ is the theory and the written standard. But yet not
everything described in the standard is implemented in any C++ compiler.
MSC++ is different from g++ and Intel, and bcc, and any other compiler.
The different support for the language makes it difficult to get "Ansi
code" running every where. Thus you may run into trouble when you try to
compile msc++ code with bcc.

I cannot tell which differences there are exactly.

Additionally each vendor add own extensions to the language (for bcc
this is e.g. __closure). When you learn BCB, it is sometimes hard to see
where Ansi C++ ends and where extensions begin.

Frank
liz
2003-09-12 11:41:04 UTC
Permalink
tell ups
er "us"
--
liz
Rory Walsh
2003-09-12 13:26:25 UTC
Permalink
Thanks Liz but in fact I was just wondering if there was a few common
differences, its just that I see in the Advanced Compiler Options I see a
language compliance section. This got me to thinking about the differences
between the two stanfards. As for my problem I think that I can figure it
out, I would prefer to find the answer myself, I will learn more that way!
However if there are a few common differences I would appreciate you
explaining them if you know? Thanks again fo the help,
Rory.
Post by liz
tell ups
er "us"
--
liz
Liz Albin
2003-09-12 13:33:52 UTC
Permalink
Post by Rory Walsh
This got me to thinking about the differences
between the two stanfards.
There's only one C++ standard: ANSI.

Again, it's not clear what's going wrong. Does your code compile? Do
you get wrong results from an executable? Are you having difficulty
linking in libraries?

Please expand, and someone will attempt to help you.
--
liz
Liz Albin
2003-09-12 14:06:55 UTC
Permalink
Okay there is only one standard but why the is there a language compliance
section in the advanced compiler options?
If you check strict compliance none of Borland's extensions will be
available (check the on line help under keywords). This means quite a
lot of code (even non-VCL) won't compile, including anything that
required window.h.
--
liz
Chris Uzdavinis (TeamB)
2003-09-13 03:53:54 UTC
Permalink
Post by Rory Walsh
Thanks Liz but in fact I was just wondering if there was a few common
differences, its just that I see in the Advanced Compiler Options I see a
language compliance section. This got me to thinking about the differences
between the two stanfards.
There is only one standard.
Post by Rory Walsh
As for my problem I think that I can figure it out, I would prefer
to find the answer myself, I will learn more that way! However if
there are a few common differences I would appreciate you explaining
them if you know? Thanks again fo the help,
I'd suggest you not use the "ANSI C++" mode in Borland C++ compilers.
It turns off features that are essential for compiling most windows
applications, making the feature practically useless.

When compiling as "Borland C++", it's probably as good as it gets with
this compiler, and if you find variations from the standard they are
compiler bugs. FYI, their next official compiler release has promise
of being 100% compliant to the standard.
--
Chris (TeamB);
Thorsten Kettner
2003-09-15 06:37:36 UTC
Permalink
Post by Rory Walsh
Hi can anyone explain to me the main difference between Ansi
C++ and Borland C++? I have a library that was written in Ansi
C++ and ports to all major platforms, windows icluded, however
when I build the library in Borland C++ Builder and try to
compile an application with it my app does not respond in
the way it should with this particular library? So can anyone
explain the major differences between the two standards in cae
thats where the problem might be? Thanks in advance.
There are no two standards, there is just one: Ansi C++. Borland
as well as Microsoft and others try to make a compiler as much
Ansi compliant as possible, but as C++ is so complicated their
solutions are not perfect.

As Borland's C++ compiler is supposed to be among the better
compilers when it comes to Ansi C++ compliance, it may as well
be that the lib you are talking about is not full Ansi standard.

My advice: Switch all warnings on in "Project options|compiler".
Then in "advanced compiler settings" set language convention to
"Ansi C++" (that tells the compiler to be very strict with
checking and not to allow any compiler specific enhancements).
Then compile. Check every warning. If the lib is really fully
Ansi compliant and the compiler does its task fine there should
be no warnings at all.

Continue reading on narkive:
Loading...