This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gfortran -frecord-marker and linking with g++
- From: Ian Lance Taylor <iant at google dot com>
- To: "Christian Ott" <blowingupstars at gmail dot com>
- Cc: gcc-help at gnu dot org
- Date: Tue, 13 Jan 2009 07:25:00 -0800
- Subject: Re: gfortran -frecord-marker and linking with g++
- References: <181c00270901100521k2a9c368cycebd5bff22cd192f@mail.gmail.com>
"Christian Ott" <blowingupstars@gmail.com> writes:
> more than a months ago I ran in to the problem described
> in the following. Back then, I did not get any responses on gcc-help.
> I am not sure if this was because of flaws in my description of the
> problem or because gcc-help is not the right place to ask the particular
> questions I was asking.
gcc-help is a good place to ask, but I suspect that the problem is
simply that nobody knows. We're mostly C/C++ people here.
You can also ask questions at fortran@gcc.gnu.org, and that may be a
better place for Fortran specific issues. See
http://gcc.gnu.org/wiki/GFortran .
> I work with a code that uses both c++ and fortran, hence I compile
> with g++ (4.3.2) and gfortran (4.3.2) and link with g++ (4.3.2). For some
> old unformatted fortran files, I need to use -frecord-marker=8 with gfortran.
> This works beautifully when compiling and linking (a standalone code) with
> gfortran. However, when wrapping a fortran routine in c++ and linking with
> g++, -frecord-marker=8 is disregarded and the executable assumes the
> standard record marker position.
I took a quick look at the compiler source code, and it appears that
-frecord-marker is implemented by automatically inserting a function
call into the main program. That means that it will only work for you
if you compile the main function in Fortran, not C++. I have no idea
whether this is a bug, a misfeature, or working as intended.
Ian