* Richard Earnshaw:

> (I think it's this patch, not one of the others in the series).
>
> This breaks building libgfortran with newlib on arm and aarch64:
>
>
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2208:46:
> error: pointer type mismatch in conditional expression
> [-Wincompatible-pointer-types]
>  2208 |                           dtp->common.iostat : &noiostat;
>       |                                              ^
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2208:27:
> note: first expression has type ‘GFC_INTEGER_4 *’ {aka ‘long int *’}
>  2208 |                           dtp->common.iostat : &noiostat;
>       |                           ^~~~~~~~~~~~~~~~~~
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2208:48:
> note: second expression has type ‘int *’
>  2208 |                           dtp->common.iostat : &noiostat;
>       |                                                ^~~~~~~~~
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2224:34:
> error: passing argument 2 of ‘dtp->u.p.fdtio_ptr’ from incompatible
> pointer type [-Wincompatible-pointer-types]
>  2224 |           dtp->u.p.fdtio_ptr (p, &unit, iotype, &vlist,
>       |                                  ^~~~~
>       |                                  |
>       |                                  int *
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2224:34:
> note: expected ‘GFC_INTEGER_4 *’ {aka ‘long int *’} but argument is of
> type ‘int *’
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2225:31:
> error: passing argument 5 of ‘dtp->u.p.fdtio_ptr’ from incompatible
> pointer type [-Wincompatible-pointer-types]
>  2225 |                               child_iostat, child_iomsg,
>       |                               ^~~~~~~~~~~~
>       |                               |
>       |                               int *
> /work/rearnsha/gnusrc/nightly/gcc-cross/master/libgfortran/io/list_read.c:2225:31:
> note: expected ‘GFC_INTEGER_4 *’ {aka ‘long int *’} but argument is of
> type ‘int *’

Presumably the fixes will look like this?

diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index db3330060ce..4fcc77dbf83 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2987,13 +2987,13 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info *nl, 
index_type offset,
            /* If this object has a User Defined procedure, call it.  */
            if (nl->dtio_sub != NULL)
              {
-               int unit = dtp->u.p.current_unit->unit_number;
+               GFC_INTEGER_4 unit = dtp->u.p.current_unit->unit_number;
                char iotype[] = "NAMELIST";
                gfc_charlen_type iotype_len = 8;
                char tmp_iomsg[IOMSG_LEN] = "";
                char *child_iomsg;
                gfc_charlen_type child_iomsg_len;
-               int noiostat;
+               GFC_INTEGER_4 noiostat;
                int *child_iostat = NULL;
                gfc_full_array_i4 vlist;
                formatted_dtio dtio_ptr = (formatted_dtio)nl->dtio_sub;


Apparently the targets I built define GFC_INTEGER_4 as int, so this
didn't show up.

Thanks,
Florian

Reply via email to