public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* fortran/6742: Generation of C++ Prototype for FORTRAN and extern "C"
@ 2002-05-20 8:16 donald.a.pellegrino
0 siblings, 0 replies; 2+ messages in thread
From: donald.a.pellegrino @ 2002-05-20 8:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 6742
>Category: fortran
>Synopsis: Generation of C++ Prototype for FORTRAN and extern "C"
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon May 20 08:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Don Pellegrino
>Release: unknown-1.0
>Organization:
>Environment:
f2c 20000510-5
>Description:
The online documentation at: http://gcc.gnu.org/onlinedocs/g77/C---Considerations.html#C++%20Considerations
Reads "C++ Considerations
f2c can be used to generate suitable code for compilation with a C++ system using the -C++ option. The important thing about linking g77-compiled code with C++ is that the prototypes for the g77 routines must specify C linkage to avoid name mangling. So, use an extern "C" declaration. f2c's -C++ option will take care of this when generating skeletons or prototype files as above, and also avoid clashes with C++ reserved words in addition to those in C."
When using f2c with -C++ and -P the .P prototype files that are generated contain only extern declarations rather than extern "C" declarations. When I link I get undefinied references unless I manually edit the .P and add the "C". I would prefer the behavior described in the documentation where the -C++ flag generates prototypes containing extern "C" instead of simply extern. Is a particular version of f2c being referenced to get the behavior specified in the g77 documentation?
>How-To-Repeat:
f2c -C++ -P file.F
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: fortran/6742: Generation of C++ Prototype for FORTRAN and extern "C"
@ 2002-11-02 3:15 toon
0 siblings, 0 replies; 2+ messages in thread
From: toon @ 2002-11-02 3:15 UTC (permalink / raw)
To: donald.a.pellegrino, gcc-bugs, gcc-prs, nobody, toon
Synopsis: Generation of C++ Prototype for FORTRAN and extern "C"
Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-By: toon
Responsible-Changed-When: Sat Nov 2 03:15:41 2002
Responsible-Changed-Why:
Fortran Maintainer.
State-Changed-From-To: open->closed
State-Changed-By: toon
State-Changed-When: Sat Nov 2 03:15:41 2002
State-Changed-Why:
This is a documentation error of g77, which will be fixed
in 3.3.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6742
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-02 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-20 8:16 fortran/6742: Generation of C++ Prototype for FORTRAN and extern "C" donald.a.pellegrino
2002-11-02 3:15 toon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).