🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49850

Re: Interfacing with other compilers

#49850
From: Fergus Henderson
Date: Fri, 24 Dec 1993 13:30
35 lines
2171 bytes
unicbe@fysik.uni-c.dk (Claus Bendtsen) writes:

>I first sent this message to bug-gcc but since I have received no
>response I now try help-gcc.
>
>I would like to use g++ on each node of a Thinking Machines, CM5 and in
>the process of doing that I've run into a few problems.
>
>I currently have a working model of the following kind,
>
>	a) main program in C, calls C++ main program adding _FiPPc.
>	b) C++ program works, calls fortran in order to use the CM5, adding
>	   _ to all calls, which further more are defined as extern "C".
>	c) Linking using fortran linker.
>
>Now my question is, since I would like not to have to include the C
>main program I need the gcc to be able to generate some routines (e.g.
>main) without expanding them, just treat them as ordinary C in order
>for the fortran linker to find them.

That's easy - just declare these routines as extern "C".
See Q106 in the comp.lang.c++ FAQ list.

>Further more I would like not to
>have to add the underscore for my fortran routines by using a different
>language style in the extern "??" definition. I can't find any language
>styles in the documentation but the C++ standard has "room" for it.

I'm afraid you're out of luck here. 
GNU C++ doesn't support extern "Fortran".

-- 
Fergus Henderson        |   "People who brook no compromise in programming
                        |   languages should program in lambda calculus or
fjh@munta.cs.mu.OZ.AU   |   machine language, depending." --Andrew Koenig.
Technical Details
Message-ID: <9335900.15896@mulga.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!pipex!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
References: <9312220727.AA18016@fysik.uni-c.dk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,16dfb054e983fe70
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-12-24 05:32:22 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!pipex!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Interfacing with other compilers
Message-ID: <9335900.15896@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU
Organization: Computer Science, University of Melbourne, Australia
References: <9312220727.AA18016@fysik.uni-c.dk>
Distribution: gnu
Date: Fri, 24 Dec 1993 13:30:36 GMT
Lines: 35