This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
g77 mangling problem
- To: egcs at egcs dot cygnus dot com
- Subject: g77 mangling problem
- From: glhenni at cs dot sandia dot gov (Gary L. Hennigan)
- Date: 31 Mar 1999 10:44:55 -0700
I just noticed a rather bothersome characteristic of g77. I'm trying
to link some Fortran functions and subroutines into a C code. If the
Fortran function name has any underlines in it g77 appends two
underline characters, e.g., "__", otherwise it appends only one
underline character. So if I have a Fortran source file with:
subroutine fort_foo_func(i, j)
subroutine fortbarfunc(i, j)
they get the symbols fort_foo_func__ and fortbarfunc_, respectively,
when compiled.
This makes it completely different from all of the compilers I've used
on other platforms and complicates any attempt at making a portable
code, as portable as you can get when linking Fortran to C anyway. Is
there any way around this problem? I can deal with appending either
two or one underline character, but when both of the methods are used
simultaneously depending on the name of the Fortran function, it
greatly complicates matters.
I apologize if this is not the proper forum for this problem. I had a
difficult time finding any forum related to the GNU compilers and
finally ran into this one. If there is a more appropriate place to
request assistance for this problem I'd appreciate a pointer to it.
Thanks,
Gary Hennigan