From: Jan-Benedict Glaw Date: Wed, 24 May 2023 14:35:22 +0000 (+0200) Subject: Fix sprintf length warning X-Git-Tag: basepoints/gcc-15~8970 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc0553d61e110a293d52405672cfe9919d7ecc12;p=thirdparty%2Fgcc.git 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. --- 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;