liboping
liboping copied to clipboard
Compile error
Currently the building of the package 1.10.0 fails on Fedora 29 with:
gcc -DHAVE_CONFIG_H -I. -DUSE_NCURSES=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c -o noping-oping.o `test -f 'oping.c' || echo './'`oping.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -Wall -Werror -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c liboping.c -fPIC -DPIC -o .libs/liboping_la-liboping.o
liboping.c: In function 'ping_host_add':
liboping.c:207:9: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 243 [-Werror=format-truncation=]
"%s: %s", function, message);
^~
liboping.c:1644:40:
ping_set_error (obj, "getaddrinfo", errmsg);
~~~~~~
In file included from /usr/include/stdio.h:861,
from liboping.c:30:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 14 and 269 bytes into a destination of size 256
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:582: liboping_la-liboping.lo] Error 1
$ rpm -q gcc
gcc-8.1.1-1.fc29.x86_64
Same issue on Debian Unstable: https://bugs.debian.org/897790
Seems to happen if liboping is compiled with GCC 8.
Hi Florian,
thanks for the fix! Mind doing a new release with that fix?
Please do a release on this fix :) thanks