From fc0553d61e110a293d52405672cfe9919d7ecc12 Mon Sep 17 00:00:00 2001 From: Jan-Benedict Glaw Date: Wed, 24 May 2023 16:35:22 +0200 Subject: [PATCH] Fix sprintf length warning One of the supplied argument strings is unneccesarily long (c-sky, using basically the same code, fixed it to a shorter length) and this fixes overflow warnings, as GCC fails to deduce that the full 256 bytes for load_op[] are not used at all. gcc/ChangeLog: * config/mcore/mcore.cc (output_inline_const) Make buffer smaller to silence overflow warnings later on. --- gcc/config/mcore/mcore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/mcore/mcore.cc b/gcc/config/mcore/mcore.cc index 92e7f960f75c..e933b03cdff5 100644 --- a/gcc/config/mcore/mcore.cc +++ b/gcc/config/mcore/mcore.cc @@ -1182,7 +1182,7 @@ output_inline_const (machine_mode mode, rtx operands[]) int trick_no; rtx out_operands[3]; char buf[256]; - char load_op[256]; + char load_op[128]; const char *dst_fmt; HOST_WIDE_INT value; -- 2.47.2