From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6805 invoked by alias); 20 May 2002 15:16:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6730 invoked by uid 71); 20 May 2002 15:16:02 -0000 Resent-Date: 20 May 2002 15:16:02 -0000 Resent-Message-ID: <20020520151602.6729.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, donald.a.pellegrino@usa.dupont.com Received:(qmail 30427 invoked by uid 61); 20 May 2002 15:07:08 -0000 Message-Id:<20020520150708.30426.qmail@sources.redhat.com> Date: Mon, 20 May 2002 08:16:00 -0000 From: donald.a.pellegrino@usa.dupont.com Reply-To: donald.a.pellegrino@usa.dupont.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: fortran/6742: Generation of C++ Prototype for FORTRAN and extern "C" X-SW-Source: 2002-05/txt/msg00611.txt.bz2 List-Id: >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: