Group :: Shelss
RPM: mrsh
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: 0001-parser-make-an-auto-const-char-array-static.patch
Download
Download
From f0a7349faf4a0e752302c8896aca5033dcd54f8a Mon Sep 17 00:00:00 2001
From: Arseny Maslennikov <arseny@altlinux.org>
Date: Sat, 10 Apr 2021 17:33:05 +0300
Subject: [PATCH] parser: fix build with gcc 10's -Wformat-truncation
To: ~emersion/mrsh-dev@lists.sr.ht
There is no reason for the array to not be static, and this qualifier
prevents type erasure so this file can be compiled with
-Werror=format-truncation.
---
parser/program.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parser/program.c b/parser/program.c
index 921f7cf..6214751 100644
--- a/parser/program.c
+++ b/parser/program.c
@@ -875,7 +875,7 @@ static struct mrsh_function_definition *function_definition(
}
static bool unspecified_word(struct mrsh_parser *parser) {
- const char *const reserved[] = {
+ static const char *const reserved[] = {
"[[",
"]]",
"function",
--
2.29.3