🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1530

Re: Linkage revisited

#1530
From: Steve Clamage
Date: Tue, 01 Aug 1995 15:39
55 lines
3013 bytes
In article 1403@ittpub, wil@ittpub.nl (Wil Evers) writes:
>In article <DCErIA.IJt@research.att.com> ark@research.att.com (Andrew  
>Koenig) writes:
>> 
>> Here are a few questions that should help point out why this is a
>> hard problem:
>> 
>> 	1. Suppose you have two mutually incompatible C compilers on
>> 	your machine?  Is every C++ compiler required to be compatible
>> 	with both of them?  If not, suppose your C++ compiler is  
>compatible
>> 	with only one of them and you remove that C compiler.  Does that
>> 	invalidate the C++ compiler?
>> 
>> 	2. Suppose the C compiler vendor changes linkage conventions
>> 	incompatibly.  Does that invalidate the C++ compiler?
>> 
>> In both these cases, the question `Does that invalidate the C++  
>compiler'
>> means `Does the vendor of this C++ compiler lose the right to claim that
>> that compiler conforms to the standard?'
>> 
>> If the answer is `yes,' that means that in effect one can produce a
>> standard-conforming C++ compiler only by permission of the C compiler
>> vendors for that machine.  If the answer is `no,' it is hard to see how
>> to write a requirement for compatibility.
>
>I can't understand why the committee is having such a hard time over this  
>issue. Why not just require a C++ implementation to specify with which C  
>compiler(s) (and versions) it is compatible on a given platform?

Let's suppose the committee makes exactly that requirement. Your C++
compiler manual says "This C++ compiler is compatible with the XYZ C
compiler, version 2.0.2," thus complying with the requirement. Are you now
better off than you were before?

I don't think so, unless you happen to use the XYZ C compiler, version 2.0.2.
If you use the TUV C compiler, you would have to find out about its compatibility
with XYZ or with your C++ compiler somehow. If you use XYZ version 1.9.8
or version 2.1, you have to do the same research.

What you really want is an ABI on the platform, and assurances that your
C++ compiler and your C compiler each follow the ABI. That is outside the
scope of the C++ standard.

Personally, I think this area is best left as a "quality of implementation"
issue. Any C++ implementor must make a reasonable effort to ensure
compatibility with at least one common C compiler on the platform, or no one
will use the C++ compiler. Usually, the C++ supplier supplies the C
compiler as well, making this a non-issue. Whether that is so or not, the
C++ vendor must, out of self-interest, tell you about compatibility with
other compilers on the system.

---
Steve Clamage, stephen.clamage@eng.sun.com
Technical Details
Message-ID: <3vlhsd$s3i@engnews2.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!usenet
References: <1995Aug1.105954.1403@ittpub>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!usenet
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: Linkage revisited
Date: 1 Aug 1995 15:39:57 GMT
Organization: Sun Microsystems Inc.
Message-ID: <3vlhsd$s3i@engnews2.Eng.Sun.COM>
References: <1995Aug1.105954.1403@ittpub>
Reply-To: clamage@Eng.Sun.COM
NNTP-Posting-Host: taumet.eng.sun.com