This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Fortran argument list issue
- From: Tobias Burnus <burnus at net-b dot de>
- To: Bernd Schmidt <bernds at codesourcery dot com>, gfortran <fortran at gcc dot gnu dot org>
- Date: Wed, 13 Aug 2014 23:46:50 +0200
- Subject: Re: Fortran argument list issue
- Authentication-results: sourceware.org; auth=none
- References: <53E01D1E dot 8010009 at codesourcery dot com>
Bernd,
Bernd Schmidt wrote:
here is one of the testcases I mentioned at the Cauldron. In
gfortran.dg/data_namelist_conflict.f90, a void argument in the middle
of an argument list is seen for _gfortran_st_set_nml_var
As band-aid try:
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -470 +470 @@ gfc_build_io_library_fndecls (void)
- void_type_node, gfc_charlen_type_node, gfc_int4_type_node);
+ gfc_int4_type_node, gfc_charlen_type_node, gfc_int4_type_node);
or use "gfc_array_index_type".
However, there is something else broken: The call uses a ptrdiff_t
(alias gfc_array_index_type in the FE or index_type in libgfortran) by
invoking the IARG() macro. But the library uses GFC_INTEGER_4 (=
int32_t). For st_set_nml_var_dim's n_dim, using "int" is more reasonable
while for st_set_nml_var's len, I'd use a size_t or ptrdiff_t – even
though it currently assumes "int" elsewhere (e.g. nml->len in
libgfortran explicitly has "int".)
I have to think about what data type is best before writing and
submitting the final patch.
Tobias