--- Begin Message ---
Subject: |
term.c:1405:25: warning: ‘%d’ directive writing between 2 and 10 bytes into a region of size 3 |
Date: |
Sat, 1 Aug 2020 15:27:48 -0400 |
I think this can be cleared by clamping the argument.
term.c: In function ‘term_get_fkeys_1’:
term.c:1405:25: warning: ‘%d’ directive writing between 2 and 10 bytes
into a region of size 3 [-Wformat-overflow=]
sprintf (fkey, "f%d", i);
^~
term.c:1405:23: note: directive argument in the range [11, 2147483646]
sprintf (fkey, "f%d", i);
^~~~~
In file included from /usr/include/stdio.h:862:0,
from ../lib/stdio.h:43,
from termchar.h:22,
from term.c:31:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note:
‘__builtin___sprintf_chk’ output between 4 and 12 bytes into a
destination of size 4
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#42656: term.c:1405:25: warning: ‘%d’ directive writing between 2 and 10 bytes into a region of size 3 |
Date: |
Tue, 25 Aug 2020 06:38:43 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Paul Eggert <eggert@cs.ucla.edu> writes:
> I regularly get messages like that from old versions of GCC. It's better to
> ignore such messages, as we shouldn't clutter up the code merely to pacify
> older
> (or buggy) compilers.
>
> You can build with --disable-gcc-warnings to suppress the annoyances with
> older
> compilers (if you're building from Git, that is; you shouldn't need to specify
> anything if building from a tarball).
I think the consensus here is that this is a compiler bug that should be
ignored. I'm therefore closing this bug report.
--- End Message ---