This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: RFC Posix Interface Design using ISO_C_BINDING
- From: Tobias Burnus <burnus at net-b dot de>
- To: jvdelisle at verizon dot net, fortran at gcc dot gnu dot org
- Date: Wed, 18 Feb 2009 07:43:11 +0100
- Subject: Re: RFC Posix Interface Design using ISO_C_BINDING
Jerry wrote:
> Working in the error codes is the next step. I think we
> should be able to access errno directly by declaring in
> external.
Otherwise you can use the gfortran existing intrinsics
IERRNO() and PERROR().
POSIX has:
"It is unspecified whether errno is a macro or an identifier
declared with external linkage. If a macro definition
is suppressed in order to access an actual object, or a
program defines an identifier with the name errno, the
behavior is undefined."
There is an additional problem:
"An application that needs to examine the value of errno to
determine the error should set it to 0 before a function call"
Tobias