Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 869884 - app-arch/dpkg: implicit function declaration errors in configure
Summary: app-arch/dpkg: implicit function declaration errors in configure
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang c99-porting
  Show dependency tree
 
Reported: 2022-09-12 17:49 UTC by Sam James
Modified: 2023-01-03 02:48 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-12 17:49:40 UTC
It's out of date so I don't really want to spend long looking into this one.

app-arch/dpkg-1.21.1/clang15.log:184:error: call to undeclared library function 'printf' with type 'int (const char *, ...)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

Please build it with CC=clang-15 and check config.log for "error.*implicit" and investigate the issue.
Comment 1 Georgy Yakovlev archtester gentoo-dev 2022-11-22 06:23:29 UTC
while bumping I noticed that's it's actual check we want failing:


configure:25516: checking for clang-15 options needed to detect all undeclared functions
configure:25538: clang-15 -c -O2 -mcpu=power9 -ftree-vectorize -pipe -frecord-gcc-switches -fdiagnostics-show-option -fdiagnostics-color=always   conftest.c >&5
^[[1mconftest.c:73:8: ^[[0m^[[0;1;35mwarning: ^[[0m^[[1mcall to undeclared library function 'strchr' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]^[[0m
(void) strchr;
^[[0;1;32m       ^
^[[0m^[[1mconftest.c:73:8: ^[[0m^[[0;1;30mnote: ^[[0minclude the header <string.h> or explicitly provide a declaration for 'strchr'^[[0m


>


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
if test ${ac_cv_c_undeclared_builtin_options+y}
then :
  printf %s "(cached) " >&6
else $as_nop
  ac_save_CFLAGS=$CFLAGS
   ac_cv_c_undeclared_builtin_options='cannot detect'
   for ac_arg in '' -fno-builtin; do
     CFLAGS="$ac_save_CFLAGS $ac_arg"
     # This test program should *not* compile successfully.
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */



it fails the same with CFLAGS='-Werror=implicit-function-declaration', yet compiles fine.
Comment 2 Larry the Git Cow gentoo-dev 2022-11-22 07:20:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3ae0b29591523de6da75104d72fe4bbdb367acb

commit c3ae0b29591523de6da75104d72fe4bbdb367acb
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-11-22 06:49:13 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-11-22 07:18:56 +0000

    app-arch/dpkg: add 1.20.12
    
    fix printf conftest missing include
    Bug: https://bugs.gentoo.org/869884
    
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 app-arch/dpkg/Manifest                          |  1 +
 app-arch/dpkg/dpkg-1.20.12.ebuild               | 97 +++++++++++++++++++++++++
 app-arch/dpkg/files/dpkg-1.20.12-m4-stdio.patch | 25 +++++++
 3 files changed, 123 insertions(+)
Comment 3 Georgy Yakovlev archtester gentoo-dev 2022-11-22 07:22:07 UTC
as Sam pointed out printf warning was legit.
added patch, it should probably work with older versions if needed.