This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fortran argument list issue


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]