Re: Reading external variables from a library (BIND)
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Reading external variables from a library (BIND)         

Group: comp.lang.fortran · Group Profile
Author: Raúl
Date: Sep 17, 2008 02:39

On 17 sep, 09:20, Ian Bush <ianbush.throwaway.acco...@googlemail.com>
wrote:
> On 17 Sep, 07:37, Arjen Markus wrote:
>
>
>
>> On 16 sep, 17:06, glen herrmannsfeldt ugcs.caltech.edu> wrote:
>
>>> Arjen Markus wrote:
>
>>> (snip)
>
>>>> The easiest way to deal with errno, I'd say, is create a
>>>> small C function along these lines:
>
>>>> void get_errno( int &errno_value ) {
>>>>     *errno_value = errno;
>>>> }
>
>>> or
>
>>> int get_errno() {
>>>      return errno;
>
>>> }- Tekst uit oorspronkelijk bericht niet weergeven -
>
>>> - Tekst uit oorspronkelijk bericht weergeven -
>
>> I did not do it that way, because a function without arguments
>> can be optimised away - cf. the design of random_number.
>
> Maybe
>
> volatile int get_errno() {
>       return errno;
>
> ? No idea if you can do this in C. In fortran at least according to
> MR&C volatile can only be
> applied to variables
>
> Ian

Thanks to everybody for your suggestions. I suppose that is not a
problem of external library. It should be a problem of using a bad
symbol name.

I tried your two solution and they work fine. But finally I found a
more clean solution, use ierrno_() intrinsic compatible in XL Fortran.
I didn't realize its existence.

Thanks for your help.
no comments
diggit! del.icio.us! reddit!