This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: types in g95
- From: Paul Brook <paul at nowt dot org>
- To: Lars Segerlund <lars dot segerlund at comsys dot se>, fortran at gcc dot gnu dot org
- Date: Mon, 27 Oct 2003 21:53:35 +0000
- Subject: Re: types in g95
- References: <20031027135728.1b31761b.lars.segerlund@comsys.se>
On Monday 27 October 2003 12:57 pm, Lars Segerlund wrote:
> Hi,
>
> Since I am looking at the intrinsic modules and C API i have been
> looking through the handling of types i gfortran, what I have found is
> that we have a set of backend type nodes which for now is mapped to the C
> types, however if I am not mistaken I have to create a set explicitly
> mapped to the C types, ( set of backend nodes ), in order to provide the
> correct mapping to C types.
>
> Does this sound reasonable or am I barking up the wrong tree ?
I don't think this is neccessary. AFAICS all you need to do is provide
constants that specify which types kinds relate to which C types. Our
existing kinds should be sufficient to implement the required
functionality. If not we should add extra fortran kinds rather than
creating extra backend nodes.
i.e. on i386-linux we would just provide the equivalent of
module ISO_C_BINDING
integer, parameter :: C_SHORT = 2, C_INT = 4, C_LONG = 4
integer, parameter :: C_FLOAT = 4, C_DOUBLE = 8, C_LONG_DOUBLE = -4
integer, parameter :: C_CHAR = 1
end module
The C_PTR type should probably be implemented by making it an alias for the
appropriate integer type. It may be easiest to keep it as a seperate type
until we start generating backend trees.
Paul