https://gcc.gnu.org/g:4f9c7b5258f2af89bba8e954c277981d2e2ee1ef

commit r16-638-g4f9c7b5258f2af89bba8e954c277981d2e2ee1ef
Author: Thomas Koenig <tkoe...@gcc.gnu.org>
Date:   Wed May 14 20:11:48 2025 +0200

    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.

Diff:
---
 gcc/fortran/dump-parse-tree.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 8d5e25dd10b8..3cd2eeef11a6 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