Re: Why We Use C Than C++...



Walter Bright wrote:

> There is one case where using a C++ compiler for C code may increase
> performance - C++ uses a different function calling convention than C, a
> faster one. The reason C compilers don't adopt it is for binary
> compatibility with C compilers that predate function prototypes.

How important is binary compatibility with an older compiler? It
would seem normal to recompile source for new compilers. Aren't there
differences between compilers that pass some parameters in registers
vs. all on stack? In C, you could easily use called function stack
cleanup for all non-variadic functions, I would think. The compiler
could even have a compatibility mode, for caller cleanup, and
different entry point naming prefix for faster calling mode, couldn't
it?

--
Thad
.



Relevant Pages

  • Re: C# Plugin system - same interface in two different assemblies...
    ... easy to see why the .NET designers went with the tried and true approach of just checking a unique identifier for each type. ... This is essentially what you achieve with COM by saying "yes, I implement this interface with this UID too", but then you want it by structural compatibility, not an agreed-upon UID. ... I'm not sure what you mean, as GCC, Intel, and Microsoft's compilers all produce compatible plugins for several products in our product suite. ... As long as you don't get subtle with multiple inheritance, method pointers or exceptions, those compilers will all produce the same low-level binary stuff to make sure it'll work with the other compilers. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: good c compiler
    ... software that compiles under MSVC. ... There are valid reasons for doing this and these apply to closed source libraries as well as open source code. ... For all I know unlike with some other compilers you provide no compatibility with libraries built with MSVC, I just assumed your users might want to be able to use third-party pre-built libraries, since I know that I do, and in that case they need to be aware of any compatibility issues. ...
    (comp.lang.c)
  • Re: usual nontechnical issues
    ... interest from MS in making compatibility complete). ... apps without spending an extra penny than Delphi Standard doesn't seem to ... players now might change when smaller players offer more cost-effective ... > of a bunch of 3rdparty compilers. ...
    (borland.public.delphi.non-technical)
  • Re: Statement on backwards compatibility?
    ... If we upgrade our machines to the latest ... OS, and also the latest compilers, the critical issue is that there will ... be compatibility issue when the compilation takes place on the newer OS ... but then you're taking advantage of backward ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Statement on backwards compatibility?
    ... > OS, and also the latest compilers, the critical issue is that there will ... > be compatibility issue when the compilation takes place on the newer OS ... programming to *BREAK* compatibility. ... -GJC [MS Windows SDK MVP] ...
    (microsoft.public.win32.programmer.kernel)