Hi Jim,
I'm using gcc version 11.2.0 (Debian 11.2.0-13)
Did you try it with my small test program and -Wformat ?
The question is, who's GCC is doing the right thing?
- Craig
On Thu, 17 Feb 2022 at 20:48, Jim Warner <james.warner@xxxxxxxxxxx> wrote:
On 2/17/22 1:47 AM, Craig Small wrote:
I can't find an email if I gave specifics about the warnings or not, but
they are below.
This seems a bit of a bogus warning. You are using snprintf() with a %s
which could be a long string and limiting it to 4 characters.
The issue is, not checking the return value. But! you know what the
source string is (another window name) so it won't be larger than 4 and
truncate.
There are probably three ways ahead with this:
* Disable the warning when using --enable-harden-flags
* Add a compiler note to not complain
* Change the top.c code to check the return value
I see not a lot of value of this warning, especially in this context;
what's your view?
Hi Craig,
I can't generate this warning no matter what options or CFLAGS I use.
My gcc is 11.2.0.
What's yours?
Regards,
Jim