[Bug c/83011] -Wformat-truncation wrongly computes length (depends on the position of numbers in the addition)

2017-11-20 Thread julien at trigofacile dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83011 --- Comment #4 from Julien ÉLIE --- Martin, the following thing still puzzles me. len = 52 * timer_count + 27 + (prefix == NULL ? 0 : strlen(prefix)) + 1; => gives a warning, as explained below len = 1 + 52 * timer_count + 27 + (prefix == NULL

[Bug c/83011] -Wformat-truncation wrongly computes length (depends on the position of numbers in the addition)

2017-11-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83011 --- Comment #3 from Martin Sebor --- (In reply to Julien ÉLIE from comment #2) Thanks. I can reproduce the warning with -Wstringop-truncation=2 and a small test case: $ cat d.c && gcc -g -O2 -S -Wall -Wformat-truncation=2

[Bug c/83011] -Wformat-truncation wrongly computes length (depends on the position of numbers in the addition)

2017-11-18 Thread julien at trigofacile dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83011 --- Comment #2 from Julien ÉLIE --- Created attachment 42644 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42644=edit Preprocessed translation unit of timer.c Thanks Martin for your response. I attached the result of the following

[Bug c/83011] -Wformat-truncation wrongly computes length (depends on the position of numbers in the addition)

2017-11-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83011 Martin Sebor changed: What|Removed |Added Keywords||diagnostic