From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1474) id 22B673858CDB; Wed, 24 May 2023 14:36:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22B673858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684938990; bh=RXtYV5+whgKPF8Rjte69ex8vJwh3QzNxdD5e4wEirMA=; h=From:To:Subject:Date:From; b=aVDDeq2y8iMyq6dPNBscy2fGMNFab06vBripdl4GpG8s6ircmcLpXElc7rFFCsdA2 5NLXCtSPkWAtCN/tm8W1CsFUrZMkousYQAdHb/dJ050t1SpecMGeR9/BJFMexXOCDi UQpVXcT1Y8s7Wy2Pj6fU7JXCpuyqyZFXYmlCPq/o= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jan-Benedict Glaw To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1169] Fix sprintf length warning X-Act-Checkin: gcc X-Git-Author: Jan-Benedict Glaw X-Git-Refname: refs/heads/master X-Git-Oldrev: bd99d7b3ca442390074377a3c0caad59df560eb5 X-Git-Newrev: fc0553d61e110a293d52405672cfe9919d7ecc12 Message-Id: <20230524143630.22B673858CDB@sourceware.org> Date: Wed, 24 May 2023 14:36:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:fc0553d61e110a293d52405672cfe9919d7ecc12 commit r14-1169-gfc0553d61e110a293d52405672cfe9919d7ecc12 Author: Jan-Benedict Glaw Date: Wed May 24 16:35:22 2023 +0200 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: --- 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 92e7f960f75..e933b03cdff 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;