public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1169] Fix sprintf length warning
@ 2023-05-24 14:36 Jan-Benedict Glaw
  0 siblings, 0 replies; only message in thread
From: Jan-Benedict Glaw @ 2023-05-24 14:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fc0553d61e110a293d52405672cfe9919d7ecc12

commit r14-1169-gfc0553d61e110a293d52405672cfe9919d7ecc12
Author: Jan-Benedict Glaw <jbglaw@lug-owl.de>
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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-24 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 14:36 [gcc r14-1169] Fix sprintf length warning Jan-Benedict Glaw

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).