• Bug#1066261: lintian: FTBFS: hello.c:9:5: error: implicit declaration o

    From Lucas Nussbaum@21:1/5 to All on Wed Mar 13 13:00:08 2024
    Source: lintian
    Version: 2.117.0
    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):
    cc -o strong \
    -Wdate-time -D_FORTIFY_SOURCE=2 \
    -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>/debian/test-out/packages/checks/binaries/hardening/binaries-hardening/binaries-hardening-1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-
    security -fcf-protection \
    -Wl,-z,relro -Wl,-z,now \
    hello.c
    hello.c: In function 'report':
    hello.c:9:5: error: implicit declaration of function 'strcpy' [-Werror=implicit-function-declaration]
    9 | strcpy(buf, string);
    | ^~~~~~
    hello.c:2:1: note: include '<string.h>' or provide a declaration of 'strcpy'
    1 | #include <stdio.h>
    +++ |+#include <string.h>
    2 |
    hello.c:9:5: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
    9 | strcpy(buf, string);
    | ^~~~~~
    hello.c:9:5: note: include '<string.h>' or provide a declaration of 'strcpy' cc1: some warnings being treated as errors
    make[2]: *** [Makefile:11: all] Error 1


    The full build log is available from: http://qa-logs.debian.net/2024/03/13/lintian_2.117.0_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 Debian Bug Tracking System@21:1/5 to All on Sun Mar 17 02:10:01 2024
    Processing control commands:

    tag -1 patch
    Bug #1066261 [src:lintian] lintian: FTBFS: hello.c:9:5: error: implicit declaration of function 'strcpy' [-Werror=implicit-function-declaration]
    Added tag(s) patch.

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James McCoy@21:1/5 to Lucas Nussbaum on Sun Mar 17 02:10:01 2024
    Control: tag -1 patch

    On Wed, Mar 13, 2024 at 12:42:03PM +0100, Lucas Nussbaum wrote:
    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):
    cc -o strong \
    -Wdate-time -D_FORTIFY_SOURCE=2 \
    -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>/debian/test-out/packages/checks/binaries/hardening/binaries-hardening/binaries-hardening-1.0=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-
    security -fcf-protection \
    -Wl,-z,relro -Wl,-z,now \
    hello.c
    hello.c: In function 'report':
    hello.c:9:5: error: implicit declaration of function 'strcpy' [-Werror=implicit-function-declaration]
    9 | strcpy(buf, string);
    | ^~~~~~
    hello.c:2:1: note: include '<string.h>' or provide a declaration of 'strcpy'
    1 | #include <stdio.h>
    +++ |+#include <string.h>
    2 |
    hello.c:9:5: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
    9 | strcpy(buf, string);
    | ^~~~~~
    hello.c:9:5: note: include '<string.h>' or provide a declaration of 'strcpy'
    cc1: some warnings being treated as errors
    make[2]: *** [Makefile:11: all] Error 1

    Attached patch fixes these issues. This is also available as MR!496 on
    Salsa.

    Cheers,
    --
    James
    GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB

    From 53dc310d4d5af6b0701d55577b30fb9a7e493bd1 Mon Sep 17 00:00:00 2001
    From: James McCoy <jamessan@debian.org>
    Date: Fri, 15 Mar 2024 12:31:42 -0400
    Subject: [PATCH] t: Fix compilation failures with dpkg 1.22.6

    Dpkg 1.22.6 enables -Werror=implicit-function-declaration by default.
    This causes various compilation failures in the tests, mainly due to
    missing includes.

    The remaining failures are due to newer GCC versions defaulting to the
    C11 standard, which doesn't expose the gets() function anymore. For
    these tests, explicitly compile with -std=c99 to re-expose the function.

    Closes: #1066261
    Signed-off-by: James McCoy <jamessan@debian.org>
    ---
    .../hardening/binaries-hardening/build-spec/orig/hello.c | 1 +
    .../binaries/static/binaries-golang/build-spec/orig/Makefile | 2 +-
    .../build-spec/orig/Makefile | 2 +-
    .../control-file-golang-built-using/build-spec/orig/Makefile | 2 +-
    .../built-using/binaries-golang/build-spec/orig/Makefile | 2 +-
    .../import-path/binaries-golang/build-spec/orig/Makefile | 2 +-
    .../control-file-golang-built-using/build-spec/orig/Makefile | 2 +-
    .../build-spec/orig/Makefile | 2 +-
    .../binaries-embedded-libs/build-spec/orig/hardening-trigger.h | 3 +++
    9 files changed, 11 insertions(+), 7 deletions(-)

    diff --git a/t/recipes/checks/binaries/hardening/binaries-hardening/build-spec/orig/hello.c b/t/recipes/checks/binaries/hardening/binaries-hardening/build-spec/orig/hello.c
    index 7b87bd737..0ee9099e1 100644
    --- a/t/recipes/checks/binaries/hardening/binaries-hardening/build-spec/orig/hello.c
    +++ b/t/recipes/checks
  • From Nilesh Patra@21:1/5 to All on Sun Mar 24 07:30:01 2024
    Control: tag -1 pending

    Hello,

    Bug #1066261 in lintian reported by you has been fixed in the
    Git repository and is awaiting an upload. You can see the commit
    message below and you can check the diff of the fix at:

    https://salsa.debian.org/lintian/lintian/-/commit/53dc310d4d5af6b0701d55577b30fb9a7e493bd1

    ------------------------------------------------------------------------
    t: Fix compilation failures with dpkg 1.22.6

    Dpkg 1.22.6 enables -Werror=implicit-function-declaration by default.
    This causes various compilation failures in the tests, mainly due to
    missing includes.

    The remaining failures are due to newer GCC versions defaulting to the
    C11 standard, which doesn't expose the gets() function anymore. For
    these tests, explicitly compile with -std=c99 to re-expose the function.

    Closes: #1066261
    Signed-off-by: James McCoy <jamessan@debian.org> ------------------------------------------------------------------------

    (this message was generated automatically)
    --
    Greetings

    https://bugs.debian.org/1066261

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Sun Mar 24 07:30:01 2024
    Processing control commands:

    tag -1 pending
    Bug #1066261 [src:lintian] lintian: FTBFS: hello.c:9:5: error: implicit declaration of function 'strcpy' [-Werror=implicit-function-declaration]
    Bug #1065431 [src:lintian] lintian: autopkgtests fail due to implicit definition of memcpy
    Added tag(s) pending.
    Added tag(s) pending.

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

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