gnulib: Add patch to allow GRUB w/GCC-15 compile

Pull in Gnulib fix to allow lib/base64.c to compile using GCC 15 or newer.

Pulled from Gnulib commit 25df6dc425 (Silence some
-Wunterminated-string-initialization warnings.)

GCC 15 adds a new compiler warning "-Wunterminated-string-initialization"
that will trigger what is considered a false-positive in lib/base64.c as
this array is not treated as a string but an array of characters so the
lack of NUL string terminator is expected.

GCC team has added ability to flag such instances of arrays that the
compiler may think are strings as "nonstring" arrays to avoid this
warning: __attribute__((nonstring)).

Fixes: https://savannah.gnu.org/bugs/?66470

Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Andrew Hamilton authored and Daniel Kiper committed 2025-06-26 17:02:21 +02:00
1 parent db506b3b83
commit ac1512b872
3 files changed
+14 -1

No files matched your search

@@ -0,0 +1,11 @@
--- a/lib/base64.c
+++ b/lib/base64.c
@@ -61,7 +61,7 @@
return ch;
}
-static const char b64c[64] =
+static const char b64c[64] _GL_ATTRIBUTE_NONSTRING =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
/* Base64 encode IN array of size INLEN into OUT array. OUT needs