From 22d1a90a1526a77585333bd6c7d9bfc1a9cbdffa Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 19 Mar 2021 15:57:06 +0000 Subject: [PATCH] Use memcpy instead of strncpy to avoid error with -Werror=stringop-truncation. gcc/ChangeLog: * config/pa/pa.c (import_milli): Use memcpy instead of strncpy. --- gcc/config/pa/pa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index d7fcd11e504..46194ba395d 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -5950,7 +5950,7 @@ import_milli (enum millicodes code) { imported[(int) code] = 1; strcpy (str, import_string); - strncpy (str + MILLI_START, milli_names[(int) code], 4); + memcpy (str + MILLI_START, milli_names[(int) code], 4); output_asm_insn (str, 0); } } -- 2.11.4.GIT