public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/target-opts-v850)] v850: silent 2 warnings
Date: Wed, 23 Jun 2021 13:49:06 +0000 (GMT)	[thread overview]
Message-ID: <20210623134906.D526E3857836@sourceware.org> (raw)

https://gcc.gnu.org/g:7836ce1fbae1a1c21806a2dfc324095e29d914a3

commit 7836ce1fbae1a1c21806a2dfc324095e29d914a3
Author: Martin Liska <mliska@suse.cz>
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)


                 reply	other threads:[~2021-06-23 13:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210623134906.D526E3857836@sourceware.org \
    --to=marxin@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).