[Bug fortran/45466] Bus Error: C program calls Fortran Function which has returned value as Character string

Lulin dot Song at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Sep 1 15:29:00 GMT 2010



------- Comment #11 from Lulin dot Song at gmail dot com  2010-09-01 15:29 -------
(In reply to comment #10)
> (In reply to comment #9)
> > when the return value is character string, is it more intuitive to be
> > 
> >  requestdouble ( real(kind=8) & rlat, real(kind=8) &
> > rlng,character(kind=1)[1:16] & __result, integer(kind=4) .__result)
> > 
> > instead of
> > 
> > requestdouble (character(kind=1)[1:16] & __result, integer(kind=4) .__result   
> > , real(kind=8) & rlat, real(kind=8) & rlng) ?
> 
> I find both equally intuitive. I think the current order matches g77 and some
> other compilers; for instance NAG uses:
>   void requestdouble_(requestdouble_Result,requestdouble_ResultLen,rlat_,rlng_)
> 
> Thus as the other order is not clearly superior, sticking to the current order
> avoids a lot of trouble both for the compiler development and for user code.
> 
> 
> > with three different compilers (Intel ifort, AbfSalford ftn95 and gfortran).
> 
> Ifort supports Fortran 2003's C binding since quite some time; I think Salfort
> doesn't nor does Absoft, but I might be wrong. (Of AbfSalfort I have never
> heard.)
> 
AbfSalfort is typo. We use Salfort ftn95 on Windows.
> For general Fortran discussion, I suggest the newsgroup comp.lang.fortran (via
> your news server or via http://groups.google.com/group/comp.lang.fortran/) or
> the gfortran mailing list.
> 
> A bug report is not the proper method of communication :-)
> 

Thanks a lot for your explaining. I thought it was bug since it behaves
different when the return type is different. I will submit future report to
mail list first to see anyone can answer there to avoid flooding the bugzilla.


-- 

Lulin dot Song at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45466



More information about the Gcc-bugs mailing list