]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix explicit arrays with non-constant size for -fc-prototypes.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Wed, 14 May 2025 18:11:48 +0000 (20:11 +0200)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Thu, 15 May 2025 17:42:12 +0000 (19:42 +0200)
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.

(cherry picked from commit 4f9c7b5258f2af89bba8e954c277981d2e2ee1ef)

gcc/fortran/dump-parse-tree.cc

index 558a2853cc43e9cfe7614a32013b645cfd9209e5..3c1060375304f2517b1a0ab206f1903f2bb42dde 100644 (file)
@@ -4336,6 +4336,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;
 }