Hello world,

this fixes the other regression which crept in with gfortran.
Again, regression-tested, plus the local testing script is
attached.

Ok for trunk and gcc-15?

Best regards

        Thomas

Fix explicit arrays with non-constant size for -fc-prototypes.

gcc/fortran/ChangeLog:

        PR fortran/120139
        * dump-parse-tree.cc (get_c_type_name): If no constant
        size of an array exists, output an asterisk.

Attachment: test-pr120139.sh
Description: application/shellscript

diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 8d5e25dd10b..3cd2eeef11a 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -4371,6 +4371,8 @@ get_c_type_name (gfc_typespec *ts, gfc_array_spec *as, const char **pre,
 	  mpz_clear (sz);
 	  *asterisk = false;
 	}
+      else
+	*asterisk = true;
     }
   return ret;
 }

Reply via email to