chmlib: FTBFS: chm_http.c:167:32: error: implicit declaration of function ‘inet_addr’ [-Werror=implicit-function-declaration]

Bug #2062947 reported by Zixing Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chmlib (Debian)
New
Unknown
chmlib (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Imported from Debian bug http://bugs.debian.org/1066327:

Source: chmlib
Version: 2:0.40a-8
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: <email address hidden>
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):
> x86_64-linux-gnu-gcc -DPACKAGE_NAME=\"chmlib\" -DPACKAGE_TARNAME=\"chmlib\" -DPACKAGE_VERSION=\"0.40\" -DPACKAGE_STRING=\"chmlib\ 0.40\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"chmlib\" -DVERSION=\"0.40\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBPTHREAD=1 -DHAVE_MALLOC=1 -I. -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 -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -DCHM_MT -DCHM_USE_PREAD -DCHM_USE_IO64 -MT test_chmLib.o -MD -MP -MF .deps/test_chmLib.Tpo -c -o test_chmLib.o test_chmLib.c
> chm_http.c: In function ‘chmhttp_server’:
> chm_http.c:167:32: error: implicit declaration of function ‘inet_addr’ [-Werror=implicit-function-declaration]
> 167 | bindAddr.sin_addr.s_addr = inet_addr(config_bind);
> | ^~~~~~~~~
> chm_http.c:179:9: error: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Werror=implicit-function-declaration]
> 179 | close(server.socket);
> | ^~~~~
> | pclose
> chm_http.c:192:73: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness [-Wpointer-sign]
> 192 | slave->fd = accept(server.socket, (struct sockaddr *)&bindAddr, &addrLen);
> | ^~~~~~~~
> | |
> | int *
> In file included from chm_http.c:43:
> /usr/include/x86_64-linux-gnu/sys/socket.h:307:42: note: expected ‘socklen_t * restrict’ {aka ‘unsigned int * restrict’} but argument is of type ‘int *’
> 307 | socklen_t *__restrict __addr_len);
> | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
> chm_http.c: In function ‘service_request’:
> chm_http.c:343:9: error: implicit declaration of function ‘write’; did you mean ‘fwrite’? [-Werror=implicit-function-declaration]
> 343 | write(fd, INTERNAL_ERROR, strlen(INTERNAL_ERROR));
> | ^~~~~
> | fwrite
> chm_http.c:348:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
> 348 | fgets(buffer, 4096, fout);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> mv -f .deps/enum_chmLib.Tpo .deps/enum_chmLib.Po
> libtool: compile: x86_64-linux-gnu-gcc -DPACKAGE_NAME=\"chmlib\" -DPACKAGE_TARNAME=\"chmlib\" -DPACKAGE_VERSION=\"0.40\" "-DPACKAGE_STRING=\"chmlib 0.40\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"chmlib\" -DVERSION=\"0.40\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBPTHREAD=1 -DHAVE_MALLOC=1 -I. -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 -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -DCHM_MT -DCHM_USE_PREAD -DCHM_USE_IO64 -MT lzx.lo -MD -MP -MF .deps/lzx.Tpo -c lzx.c -fPIC -DPIC -o .libs/lzx.o
> mv -f .deps/enumdir_chmLib.Tpo .deps/enumdir_chmLib.Po
> mv -f .deps/test_chmLib.Tpo .deps/test_chmLib.Po
> libtool: compile: x86_64-linux-gnu-gcc -DPACKAGE_NAME=\"chmlib\" -DPACKAGE_TARNAME=\"chmlib\" -DPACKAGE_VERSION=\"0.40\" "-DPACKAGE_STRING=\"chmlib 0.40\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"chmlib\" -DVERSION=\"0.40\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBPTHREAD=1 -DHAVE_MALLOC=1 -I. -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 -Wall -Wdate-time -D_FORTIFY_SOURCE=2 -DCHM_MT -DCHM_USE_PREAD -DCHM_USE_IO64 -MT chm_lib.lo -MD -MP -MF .deps/chm_lib.Tpo -c chm_lib.c -fPIC -DPIC -o .libs/chm_lib.o
> mv -f .deps/extract_chmLib.Tpo .deps/extract_chmLib.Po
> cc1: some warnings being treated as errors
> make[2]: *** [Makefile:543: chm_http.o] Error 1

The full build log is available from:
http://qa-logs.debian.net/2024/03/13/chmlib_0.40a-8_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240313;<email address hidden>
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20240313&<email address hidden>&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.

Related branches

Changed in chmlib (Debian):
importance: Undecided → Unknown
Revision history for this message
Dave Jones (waveform) wrote :

The branch in the linked merge proposal is for noble, but the issue is still present in the oracular package (by the looks of the version numbers it's presumably present in at least noble, mantic and possibly earlier too).

I've sponsored this for oracular for now; if that lands successfully (I can't currently test locally due to armhf issues on the Pi images), this should probably be converted to an SRU bug for the affected series.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chmlib - 2:0.40a-8ubuntu1

---------------
chmlib (2:0.40a-8ubuntu1) oracular; urgency=medium

  * debian/patches/implicit-declarations.patch: Add missing includes and
    fix large file support. (LP: #2062947).

 -- Zixing Liu <email address hidden> Fri, 19 Apr 2024 20:28:40 -0600

Changed in chmlib (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.