liboping icon indicating copy to clipboard operation
liboping copied to clipboard

Cannot build with -Werror=format-security enabled

Open blalor opened this issue 3 years ago • 3 comments

https://aur.archlinux.org/packages/liboping/#comment-837040

gcc -DHAVE_CONFIG_H -I.   -DUSE_NCURSES=1 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600    -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -c -o noping-oping.o `test -f 'oping.c' || echo './'`oping.c
oping.c: In function 'update_graph_prettyping':
oping.c:1124:25: error: format not a string literal and no format arguments [-Werror=format-security]
 1124 |                         mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
      |                         ^~~~~~~~~
oping.c: In function 'update_graph_histogram':
oping.c:1222:41: error: format not a string literal and no format arguments [-Werror=format-security]
 1222 |                                         hist_symbols_utf8[index]);
      |                                         ^~~~~~~~~~~~~~~~~
oping.c: In function 'update_host_hook':
oping.c:1597:38: warning: too many arguments for format [-Wformat-extra-args]
 1597 |                         HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
oping.c:1574:45: note: in definition of macro 'HOST_PRINTF'
 1574 | # define HOST_PRINTF(...) wprintw(main_win, __VA_ARGS__)
      |                                             ^~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [Makefile:584: noping-oping.o] Error 1

blalor avatar Nov 22 '21 14:11 blalor

@blalor https://salsa.debian.org/debian/liboping/-/blob/debian/debian/patches/fix_HOST_PRINTF_format_string.patch should fix all issues, thats at least what I've just uploaded to debian.

bzed avatar Feb 22 '22 09:02 bzed

@bzed i don’t have access to that link. 😔

blalor avatar Feb 28 '22 20:02 blalor

@blalor thats because salsa is down. https://github.com/octo/liboping/pull/61 has the same content.

bzed avatar Feb 28 '22 21:02 bzed