~/sources/dump1090$ make
gcc -DMODES_DUMP1090_VERSION=\"v1.14-245-ga32d7a3\" -O2 -g -Wall -Werror -W -c interactive.c -o interactive.o
interactive.c: In function ‘interactiveShowData’:
interactive.c:140:44: error: ‘%03d’ directive output may be truncated writing between 3 and 9 bytes into a region of size 5 [-Werror=format-truncation=]
140 | snprintf(strFl,6,"F%03d",(a->altitude/100));
| ^~~~
interactive.c:140:42: note: directive argument in the range [-21474836, 21474836]
140 | snprintf(strFl,6,"F%03d",(a->altitude/100));
| ^~~
In file included from /usr/include/stdio.h:867,
from dump1090.h:65,
from interactive.c:50:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘builtin___snprintf_chk’ output between 5 and 11 bytes into a destination of size 6
67 | return builtin_snprintf_chk (s, n, USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~
68 | bos (s), fmt, va_arg_pack ());
| ~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:42: interactive.o] Error 1
I am new to Github, so please forgive me if I am not correct or complete in reporting errors.
Am available for additional information.
On Kubuntu 20.04, kernel 5.4.0.33
~/sources/dump1090$ make gcc -DMODES_DUMP1090_VERSION=\"v1.14-245-ga32d7a3\" -O2 -g -Wall -Werror -W -c interactive.c -o interactive.o interactive.c: In function ‘interactiveShowData’: interactive.c:140:44: error: ‘%03d’ directive output may be truncated writing between 3 and 9 bytes into a region of size 5 [-Werror=format-truncation=] 140 | snprintf(strFl,6,"F%03d",(a->altitude/100)); | ^~~~ interactive.c:140:42: note: directive argument in the range [-21474836, 21474836] 140 | snprintf(strFl,6,"F%03d",(a->altitude/100)); | ^
~~ In file included from /usr/include/stdio.h:867, from dump1090.h:65, from interactive.c:50: /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘builtin___snprintf_chk’ output between 5 and 11 bytes into a destination of size 6 67 | return builtin_snprintf_chk (s, n, USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~ 68 | bos (s), fmt, va_arg_pack ()); |~~~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile:42: interactive.o] Error 1I am new to Github, so please forgive me if I am not correct or complete in reporting errors. Am available for additional information.