From -6284454018313136201
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ea96cc047f6a22cc
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-08-11 16:09:01 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!btnet-peer1!btnet-peer0!btnet!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: remove.haberg@matematik.su.se (Hans Aberg)
Newsgroups: comp.std.c++
Subject: Re: extern "C" -- what is the intent?
Date: Sat, 11 Aug 2001 23:07:17 GMT
Organization: Mathematics
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <remove.haberg-1108011044500001@du136-226.ppp.su-anst.tninet.se>
References: <090820010209154805%BobbySchmidt@mac.com> <remove.haberg-1008011309410001@du132-226.ppp.su-anst.tninet.se> <9l1los$281$1@panix3.panix.com>
X-Trace: mail2news.demon.co.uk 997571285 mail2news:20147 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
NNTP-Posting-Date: 11 Aug 2001 08:44:50 GMT
Lines: 29
Xref: archiver1.google.com comp.std.c++:6942

In article <9l1los$281$1@panix3.panix.com>, comeau@comeaucomputing.com wrote:
>>  extern "C" A f(B x) {
>>    // C++ definition
>>  }
...
>> (My compiler, which is not the latest model, does not accept
>>C linkage definitions with C++ in the body, but I think that GCC might.)
>
>If I understand you correctly, I've never heard that before.
>Can you give an example of what you mean?

Plugging in some values in the example above, I arrive at say
  extern "C" int f(int) { return 1; }
My out-of-date compiler (compiling under C++) then says
  Error   : illegal function definition

But according to 7.5:2-3, 7.1:1 (A.6) and 8.4, this should be legal.

  Hans Aberg      * Anti-spam: remove "remove." from email address.
                  * Email: Hans Aberg <remove.haberg@member.ams.org>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>

---
[ 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://www.research.att.com/~austern/csc/faq.html                ]



