~emersion/mrsh-dev

parser: fix build with gcc 10's -Wformat-truncation v1 PROPOSED

Arseny Maslennikov: 1
 parser: fix build with gcc 10's -Wformat-truncation

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/mrsh-dev/patches/21964/mbox | git am -3
Learn more about email & git

[PATCH] parser: fix build with gcc 10's -Wformat-truncation Export this patch

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