This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch/i386]: -mrtd vs system library declarations
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Michael Matz <matz at suse dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: 22 Jul 2003 20:00:01 +0200
- Subject: Re: [Patch/i386]: -mrtd vs system library declarations
- Organization: Integrable Solutions
- References: <Pine.LNX.4.44.0307221931030.2024-100000@wotan.suse.de>
Michael Matz <matz@suse.de> writes:
| Hi,
|
| On 22 Jul 2003, Gabriel Dos Reis wrote:
|
| > | > extern string-literal { declaration-seq }
| > | > extern string-literal declaration
| > |
| > | In principle I agree with you; however, adding support for this
| > | notation to the C front end would be tremendously more work than
| > | adding some machine-specific #pragmas.
| >
| > I hear you, but I'm skeptical about the overall cost.
|
| Well, usually you are vehemently against introducing language extensions
| (for good reasons).
First of all, I'm not in principle against language extensions.
I happen to be against extensions that do not take into account
interactions with other language features.
| extern "stdcall" bla();
| would be one for C. So you are inconsistent at least in your requests,
| especially because the #pragma solution _does_ provide something inside
| the language.
The issue to consider is that the C programming language is the not
the only programming language affected in this issue. We also have C++.
Standard C++ already provides mechanism to specify a calling convention, with
semantics checks within the language (they interact with the rest of
the type-system). That is an important aspect to consider.
Now the question is what for the C programming language?
*Either* way, it is an extension to the C language.
Choosing the pragma approach does more damage than accepting the
linkage-specification syntax, specially given its interaction with C++.
Therefore I strongly advise against taking the pragma road.
The linkage-specification approach has the advantage that it is
well-understood and widely known. And it happens to accomodate
other languages involved in this issue.
-- Gaby