public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "José Rui Faustino de Sousa" <jrfsousa@gmail.com>
To: gcc@gcc.gnu.org
Subject: Build failure due to format-truncation
Date: Sun, 13 Jun 2021 17:48:05 +0000	[thread overview]
Message-ID: <487076c8-4863-55c6-35c3-a95c2567a7eb@gmail.com> (raw)


Hi All!

While building I started to get this error:

../../gcc-master/gcc/opts.c: In function ‘void 
print_filtered_help(unsigned int, unsigned int, unsigned int, unsigned 
int, gcc_options*, unsigned int)’:
../../gcc-master/gcc/opts.c:1497:26: error: ‘  ’ directive output may be 
truncated writing 2 bytes into a region of size between 1 and 256 
[-Werror=format-truncation=]
  1497 |                       "%s  %s", help, _(use_diagnosed_msg));
       |                          ^~
../../gcc-master/gcc/opts.c:1496:22: note: ‘snprintf’ output 3 or more 
bytes (assuming 258) into a destination of size 256
  1496 |             snprintf (new_help, sizeof new_help,
       |             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
  1497 |                       "%s  %s", help, _(use_diagnosed_msg));
       |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

My guess is that it is due to the use of the flag "-fstrict-overflow"

I am not complaining or saying that this is a bug, but the whole code 
compiles fine with this flag except for this single instance...

Thank you very much.

Best regards,
José Rui


             reply	other threads:[~2021-06-13 17:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 17:48 José Rui Faustino de Sousa [this message]
2021-06-16 16:53 ` Martin Sebor
2021-06-16 17:21   ` José Rui Faustino de Sousa
2021-06-16 20:37     ` Martin Sebor
2021-06-17  0:26       ` José Rui Faustino de Sousa
2021-06-17 20:51         ` Martin Sebor
2021-06-17 23:04           ` José Rui Faustino de Sousa
2021-06-18  0:05             ` Martin Sebor
2021-06-20 10:33               ` José Rui Faustino de Sousa

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=487076c8-4863-55c6-35c3-a95c2567a7eb@gmail.com \
    --to=jrfsousa@gmail.com \
    --cc=gcc@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).