• Bug#1066694: netdiag: FTBFS: getservent.c:121:38: error: implicit decla

    From Lucas Nussbaum@21:1/5 to All on Wed Mar 13 15:00:04 2024
    Source: netdiag
    Version: 1.2-1.2
    Severity: serious
    Justification: FTBFS
    Tags: trixie sid ftbfs
    User: lucas@debian.org
    Usertags: ftbfs-20240313 ftbfs-trixie ftbfs-impfuncdef

    Hi,

    During a rebuild of all packages in sid, your package failed to build
    on amd64.

    This is most likely caused by a change in dpkg 1.22.6, that enabled -Werror=implicit-function-declaration. For more information, see https://wiki.debian.org/qa.debian.org/FTBFS#A2024-03-13_-Werror.3Dimplicit-function-declaration

    Relevant part (hopefully):
    gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wl,-z,relro -Wl,-z,now -I/usr/
    include/ncurses -g -DSNVERSION=3.8 -Wdate-time -D_FORTIFY_SOURCE=2 -c -o win_show_stat.o win_show_stat.c
    tally_label.c:13:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    13 | tally_label ( struct Tally *Now_ts, WINDOW *win, int width, int height )
    | ^~~~~~~~~~~
    In file included from /usr/include/netdb.h:27,
    from inetprivate.h:13,
    from getservent.c:45:
    getservent.c: In function ‘sn_getservent’:
    getservent.c:121:38: error: implicit declaration of function ‘atoi’ [-Werror=implicit-function-declaration]
    121 | serv.s_port = htons((u_short)atoi(p));
    | ^~~~
    gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wl,-z,relro -Wl,-z,now -I/usr/
    include/ncurses -g -DSNVERSION=3.8 -Wdate-time -D_FORTIFY_SOURCE=2 -c -o statnetd.o statnetd.c
    gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wl,-z,relro -Wl,-z,now -I/usr/
    include/ncurses -g -DSNVERSION=3.8 -Wdate-time -D_FORTIFY_SOURCE=2 -c -o itstime.o itstime.c
    statnet.c:102:8: warning: type defaults to ‘int’ in declaration of ‘gen_all’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~
    statnet.c:102:17: warning: type defaults to ‘int’ in declaration of ‘gen_eth’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~
    statnet.c:102:26: warning: type defaults to ‘int’ in declaration of ‘gen_plip’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~~
    statnet.c:102:36: warning: type defaults to ‘int’ in declaration of ‘gen_slip’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~~
    statnet.c:102:46: warning: type defaults to ‘int’ in declaration of ‘gen_ppp’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~ statnet.c:102:55: warning: type defaults to ‘int’ in declaration of ‘gen_loop’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~~ statnet.c:102:65: warning: type defaults to ‘int’ in declaration of ‘gen_802’ [-Wimplicit-int]
    102 | static gen_all, gen_eth, gen_plip, gen_slip, gen_ppp, gen_loop, gen_802 = 0;
    | ^~~~~~~
    statnet.c:106:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    106 | main (int argc, char *argv[])
    | ^~~~
    itstime.c: In function ‘itstime’:
    itstime.c:50:9: error: implicit declaration of function ‘alarm’ [-Werror=implicit-function-declaration]
    50 | alarm (SN_STATS_SECS);
    | ^~~~~
    statnet.c: In function ‘update_display’:
    statnet.c:555:36: warning: '0' flag ignored with '-' flag in gnu_printf format [-Wformat=]
    555 | mvwprintw (genwin, 0, 0, "GENERAL Frame: /%-02d sec", SN_UPDATE_SECS);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ statnet.c:681:9: error: implicit declaration of function ‘win_show_stat’ [-Werror=implicit-function-declaration]
    681 | win_show_stat( protwin, 9, 1, noframes, &Now->prot, &Prev->prot, &Delta.prot, rewrite_labels, &update_prot_labels, &show_prot_labels );
    | ^~~~~~~~~~~~~
    gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wl,-z,relro -Wl,-z,now -I/usr/
    include/ncurses -g -DSNVERSION=3.8 -Wdate-time -D_FORTIFY_SOURCE=2 -c -o tally_init.o tally_init.c
    statnet.c: In function ‘show_tcp_labels’:
    statnetd.c:124:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    124 | main (int argc, char *argv[])
    | ^~~~
    statnet.c:800:9: error: implicit declaration of function ‘tally_label’; did you mean ‘slk_label’? [-Werror=implicit-function-declaration]
    800 | tally_label( Now_ts, tcpwin, TW, TH );
    | ^~~~~~~~~~~
    | slk_label
    cc1: some warnings being treated as errors
    cc1: some warnings being treated as errors
    statnetd.c: In function ‘handle_other’:
    statnetd.c:499:11: error: implicit declaration of function ‘tally’ [-Werror=implicit-function-declaration]
    499 | tally( (short int)buf[14], &StatMem->sap_types ); /* count 802.2 SAP number */
    | ^~~~~
    make[1]: *** [<builtin>: itstime.o] Error 1


    The full build log is available from: http://qa-logs.debian.net/2024/03/13/netdiag_1.2-1.2_unstable.log

    All bugs filed during this archive rebuild are listed at: https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240313;users=lucas@debian.org
    or: https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20240313&fusertaguser=lucas@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

    A list of current common problems and possible solutions is available at http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

    If you reassign this bug to another package, please mark it as 'affects'-ing this package. See https://www.debian.org/Bugs/server-control#affects

    If you fail to reproduce this, please provide a build log and diff it with mine so that we can identify if something relevant changed in the meantime.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Micha Lenk@21:1/5 to All on Sat Mar 23 21:10:01 2024
    This is a multi-part message in MIME format.
    Dear maintainer of netdiag,

    I tried to fix the build failures introduced by the recently by-default
    enabled compile flag -Werror=implicit-function-declaration.

    All build errors inside the statnet sub project could be fixed by the
    attached patch statnet_fix_implicit_function_declarations.patch,
    including the implicit declaration of function `atoi`.

    Unfortunately the build fails in the netwatch sub project too. Initial
    attempts to fix that can be found in the attached patch netwatch_fix_implicit_declarations.patch. However, for the implicitly
    declared function `uthread_wait` I have no clue what it refers to. So, I
    am stuck with the following build failure now:

    make[1]: Entering directory
    '/home/micha/src/netdiag/pkg.git/netwatch-1.3.1-2'
    x86_64-linux-gnu-gcc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/home/micha/src/netdiag/pkg.git/netwatch-1.3.1-2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -ggdb -O0 -Wl,-z,relro
    -Wl,-z,now -c dispdata.c
    dispdata.c: In function 'dispdata':
    dispdata.c:740:7: error: implicit declaration of function
    'uthread_wait'; did you mean 'pthread_exit'? [-Werror=implicit-function-declaration]
    740 | uthread_wait(1000);
    | ^~~~~~~~~~~~
    | pthread_exit
    dispdata.c:1357:48: warning: '%s' directive writing up to 511 bytes into
    a region of size 509 [-Wformat-overflow=]
    1357 | sprintf (&status_lines[3][3], "%s", ttt);
    | ^~ ~~~ dispdata.c:1357:17: note: 'sprintf' output between 1 and 512 bytes into
    a destination of size 509
    1357 | sprintf (&status_lines[3][3], "%s", ttt);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: some warnings being treated as errors
    make[1]: *** [Makefile:40: dispdata.o] Error 1
    make[1]: Leaving directory
    '/home/micha/src/netdiag/pkg.git/netwatch-1.3.1-2'
    make: *** [debian/rules:36: build-stamp] Error 2
    dpkg-buildpackage: error: debian/rules build subprocess returned exit
    status 2


    A solution could be to selectively disable the -Werror=implicit-function-declaration option again, but having seen this
    error I don't feel comfortable moving forward in that direction.

    I'll stop here, sharing the changes for how far I got already in the
    hope it is useful to any more skilled or more patient developer.

    Kind regards,
    Micha
    QXV0aG9yOiBNaWNoYSBMZW5rIDxtaWNoYUBkZWJpYW4ub3JnPgoKZGlmZiAtLWdpdCBhL3N0 YXRuZXQtMy44L2dldHNlcnZlbnQuYyBiL3N0YXRuZXQtMy44L2dldHNlcnZlbnQuYwppbmRl eCAxZWU2ZTVlLi5kOTk4NzRiIDEwMDY0NAotLS0gYS9zdGF0bmV0LTMuOC9nZXRzZXJ2ZW50 LmMKKysrIGIvc3RhdG5ldC0zLjgvZ2V0c2VydmVudC5jCkBAIC00Miw2ICs0Miw4IEBACiBz dGF0aWMgY2hhciBzY2NzaWRbXSA9ICJAKCMpZ2V0c2VydmVudC5jCTguMSAoQmVya2VsZXkp IDYvNC85MyI7CiAjZW5kaWYgLyogTElCQ19TQ0NTIGFuZCBub3QgbGludCAqLwogCisjaW5j bHVkZSA8c3RkbGliLmg+CisKICNpbmNsdWRlICJpbmV0cHJpdmF0ZS5oIgogCiAjZGVmaW5l CU1BWEFMSUFTRVMJMzUKZGlmZiAtLWdpdCBhL3N0YXRuZXQtMy44L2l0c3RpbWUuYyBiL3N0 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WluIChp bnQgZm9yY2UpOwogaW50IGhhc2hwb3J0KCBpbnQgcG9ydCwgaW50IGhhc2gpOwogdm9pZCBp bml0bGlzdChzdHJ1Y3QgcG9ydF9pbmZvICpmaXJzdFtdLCBpbnQgaGFzaCk7CiBjaGFyICpz ZWFyY2hsaXN0KHN0cnVjdCBwb3J0X2luZm8gKmZpcnN0W10sIGludCBwb3J0LCBpbnQgaGFz aCk7CiBjaGFyICpzZXJ2aWNlbm0oIGNoYXIgKnMsIGludCBwb3J0KTsKK3ZvaWQgc2V0dXBo ZWxwICgpOwogCiAKIAkK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Thu Apr 11 05:50:01 2024
    Processing control commands:

    tags -1 patch
    Bug #1066694 [src:netdiag] netdiag: FTBFS: getservent.c:121:38: error: implicit declaration of function ‘atoi’ [-Werror=implicit-function-declaration]
    Added tag(s) patch.

    --
    1066694: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1066694
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)