This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pow_ functions in fortran.


Spundun Bhatt wrote:
Andrew Pinski wrote:
I am trying to compile this code and running into a problem with functions pow_ci pow_cl pow_cc pow_zi pow_zl pow_zz .


gfortran appends one underscore to a symbol, but then some code here seems to expect a leading underscore (_foo instead of foo_) and sometimes it seems to expect double underscores. Is there a known discrepancy between versions of fortran or compiler vendors regarding this underscore behavior?

gcc would be likely to prepend an underscore, without appending any. gfortran is somewhat consistent with f2c in that the usual default is to append a single underscore, making that the only thing to distinguish C and Fortran namespaces. g77 had a different scheme, involving double appended underscores. Consult the info or man pages for the compilers/translators you are involved with, if you really are willing to deal with the problems involved with the options most have to change their linkage conventions.
Many configure scripts have automatic schemes to discover the linkage scheme of the Fortran compiler in use. Avoid second guessing this stuff yourself. Ability to mix differing Fortran compilers is limited anyway.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]