From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 95779395542A; Mon, 28 Jun 2021 09:28:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95779395542A MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1839] v850: silent 2 warnings X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: 22069036efda4661862aeee213859f1ee8511ab5 X-Git-Newrev: ad26c076aaa6f9af144c33c9c04c5dc8010ad156 Message-Id: <20210628092836.95779395542A@sourceware.org> Date: Mon, 28 Jun 2021 09:28:36 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 09:28:36 -0000 https://gcc.gnu.org/g:ad26c076aaa6f9af144c33c9c04c5dc8010ad156 commit r12-1839-gad26c076aaa6f9af144c33c9c04c5dc8010ad156 Author: Martin Liska Date: Wed Jun 23 15:48:28 2021 +0200 v850: silent 2 warnings Silents: /home/marxin/Programming/gcc/gcc/config/v850/v850.c: In function ‘char* construct_dispose_instruction(rtx)’: /home/marxin/Programming/gcc/gcc/config/v850/v850.c:2690:22: warning: ‘%s’ directive writing up to 99 bytes into a region of size between 79 and 89 [-Wformat-overflow=] 2690 | sprintf (buff, "dispose %d {%s}, r31", stack_bytes / 4, regs); | ^~~~~~~~~~~~~~~~~~~~~~ ~~~~ /home/marxin/Programming/gcc/gcc/config/v850/v850.c:2690:15: note: ‘sprintf’ output between 18 and 127 bytes into a destination of size 100 2690 | sprintf (buff, "dispose %d {%s}, r31", stack_bytes / 4, regs); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/marxin/Programming/gcc/gcc/config/v850/v850.c: In function ‘char* construct_prepare_instruction(rtx)’: /home/marxin/Programming/gcc/gcc/config/v850/v850.c:2814:22: warning: ‘%s’ directive writing up to 99 bytes into a region of size 91 [-Wformat-overflow=] 2814 | sprintf (buff, "prepare {%s}, %d", regs, (- stack_bytes) / 4); | ^~~~~~~~~~~~~~~~~~ ~~~~ /home/marxin/Programming/gcc/gcc/config/v850/v850.c:2814:15: note: ‘sprintf’ output between 14 and 123 bytes into a destination of size 100 2814 | sprintf (buff, "prepare {%s}, %d", regs, (- stack_bytes) / 4); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc/ChangeLog: * config/v850/v850.c (construct_dispose_instruction): Allocate a bigger buffer. (construct_prepare_instruction): Likewise. Diff: --- gcc/config/v850/v850.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 371e6026e9a..4978faf9318 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -2583,7 +2583,7 @@ construct_dispose_instruction (rtx op) int stack_bytes; unsigned long int mask; int i; - static char buff[ 100 ]; /* XXX */ + static char buff[ 120 ]; /* XXX */ int use_callt = 0; if (count <= 2) @@ -2704,7 +2704,7 @@ construct_prepare_instruction (rtx op) int stack_bytes; unsigned long int mask; int i; - static char buff[ 100 ]; /* XXX */ + static char buff[ 120 ]; /* XXX */ int use_callt = 0; if (XVECLEN (op, 0) <= 1)