Not many newlib targets (IIRC the only targets where
int32_t is a typedef of long int) build libgfortran.

Building and testing fortran testsuite is usually a cheap
way to get additional coverage for a port, except that a
couple of times a year, there are these silly type-related
breakages.

Maybe change to building libgfortran as C++? 1/2 :-)

Committed as obvious after a build of libgfortran for
cris-elf succeeded with this patch.

-- >8 --
Without this, after r15-6415-g586477d67bf2e3, you'll see,
for targets where int32_t is a typedef of long int (beware
of artificially broken lines):

/x/gcc/libgfortran/caf/single.c: In function '_gfortran_caf_get_by_ct':
/x/gcc/libgfortran/caf/single.c:2943:56: error: passing argument 2 of '\
(accessor_hash_table + (sizetype)((unsigned int)getter_index * 12))->ac\
cessor' from incompatible pointer type [-Wincompatible-pointer-types]
 2943 |   accessor_hash_table[getter_index].accessor (dst_ptr, &free_bu\
ffer, src_ptr,
      |                                                        ^~~~~~~~\
~~~~
      |                                                        |
      |                                                        int *
/x/gcc/libgfortran/caf/single.c:2943:56: note: expected 'int32_t *' {ak\
a 'long int *'} but argument is of type 'int *'

libgfortran:
        * caf/single.c (_gfortran_caf_get_by_ct): Correct type of free_buffer
        to int32_t.
---
 libgfortran/caf/single.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c
index f5414ff1f7ef..23ad44e1c162 100644
--- a/libgfortran/caf/single.c
+++ b/libgfortran/caf/single.c
@@ -2927,7 +2927,7 @@ _gfortran_caf_get_by_ct (
 {
   caf_single_token_t single_token = TOKEN (token);
   void *src_ptr = opt_src_desc ? (void *) opt_src_desc : single_token->memptr;
-  int free_buffer;
+  int32_t free_buffer;
   void *dst_ptr = opt_dst_desc ? (void *)opt_dst_desc : dst_data;
   void *old_dst_data_ptr = NULL;
 
-- 
2.30.2

Reply via email to