]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gnat: fix lto-type-mismatch between C_Version_String and gnat_version_string [PR115917]
authorArsen Arsenović <arsen@aarsen.me>
Thu, 15 Aug 2024 17:17:41 +0000 (19:17 +0200)
committerArsen Arsenović <arsen@gcc.gnu.org>
Mon, 19 Aug 2024 09:03:39 +0000 (11:03 +0200)
gcc/ada/ChangeLog:

PR ada/115917
* gnatvsn.ads: Add note about the duplication of this value in
version.c.
* version.c (VER_LEN_MAX): Define to the same value as
Gnatvsn.Ver_Len_Max.
(gnat_version_string): Use VER_LEN_MAX as bound.

gcc/ada/gnatvsn.ads
gcc/ada/version.c

index 6cf170dc4cad7635d50c051874ae60c5268e0beb..ca7744b9767ec6f7f2544a31254e1ff107902517 100644 (file)
@@ -83,7 +83,8 @@ package Gnatvsn is
    --  space to store any possible version string value for checks. This
    --  value should never be decreased in the future, but it would be
    --  OK to increase it if absolutely necessary. If it is increased,
-   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max as well.
+   --  be sure to increase GNAT.Compiler.Version.Ver_Len_Max, and to update
+   --  the VER_LEN_MAX define in version.c as well.
 
    Ver_Prefix : constant String := "GNAT Version: ";
    --  Prefix generated by binder. If it is changed, be sure to change
index 5e64edd0b17d39e3008c970c3699ed348590f893..2fa9b8c2c8592acc8d87b6fe77e1e4eeb8d78e86 100644 (file)
@@ -31,4 +31,7 @@
 
 #include "version.h"
 
-char gnat_version_string[] = version_string;
+/* Logically a reference to Gnatvsn.Ver_Len_Max.  Please keep in sync.  */
+#define VER_LEN_MAX 256
+
+char gnat_version_string[VER_LEN_MAX] = version_string;