clang -DHAVE_CONFIG_H -I. -I.. -pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int -c -o xsize.o xsize.c clang -DHAVE_CONFIG_H -I. -I.. -pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int -c -o obstack.o obstack.c clang -DHAVE_CONFIG_H -I. -I.. -pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int -c -o basename-lgpl.o basename-lgpl.c clang -DHAVE_CONFIG_H -I. -I.. -pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int -c -o uinttostr.o uinttostr.c obstack.c:351:31: error: incompatible function pointer types initializing 'void (*)(void) __attribute__((noreturn))' with an expression of type 'void (void)' [-Werror,-Wincompatible-function-pointer-types] ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1_no_multilib-j4-20221108-023017 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-12 * clang/llvm (if any): clang version 15.0.4 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/15/bin Configuration file: /etc/clang/clang.cfg /usr/lib/llvm/15 15.0.4 Python 3.10.8 Available Rust versions: [1] rust-bin-1.64.0 * The Glorious Glasgow Haskell Compilation System, version 8.10.6 php cli (if any): GNU Make 4.4 HEAD of ::gentoo commit 5c62c228257b375a4680cb55f3573cbf3d80326c Author: Repository mirror & CI <repomirrorci@gentoo.org> Date: Tue Nov 8 09:01:56 2022 +0000 2022-11-08 09:01:56 UTC emerge -qpvO app-arch/cpio [ebuild N ] app-arch/cpio-2.13-r3 USE="nls"
Created attachment 828957 [details] emerge-info.txt
Created attachment 828959 [details] app-arch:cpio-2.13-r3:20221108-092752.log
Created attachment 828961 [details] clang.tar.bz2
Created attachment 828963 [details] emerge-history.txt
Created attachment 828965 [details] environment
Created attachment 828967 [details] etc.portage.tar.bz2
Created attachment 828969 [details] logs.tar.bz2
Created attachment 828971 [details] temp.tar.bz2
Created attachment 838639 [details, diff] Change C11 _Noreturn into __attribute__((noreturn)) in obstack.c Changing '_Noreturn' on line 329 to __attribute_noreturn__ on the declaration of print_and_abort at obstack.c works for me. Seems Clang doesn't treat C11 _Noreturn as equivalent to __attribute__((noreturn)), while GCC does.
(In reply to Carlos from comment #9) > Created attachment 838639 [details, diff] [details, diff] > Change C11 _Noreturn into __attribute__((noreturn)) in obstack.c > > Changing '_Noreturn' on line 329 to __attribute_noreturn__ on the > declaration of print_and_abort at obstack.c works for me. > > Seems Clang doesn't treat C11 _Noreturn as equivalent to > __attribute__((noreturn)), while GCC does. Could you send the patch upstream to the Savannah link I posted, but also, does this work fine with GCC? I wonder if we'll need to use a configure check to make this palatable to upstream. Thanks!
The patch compiles on both my clang and my gcc environment. Both with LTO.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e82c66c6494159d59fe2d771f8eec43748dd869b commit e82c66c6494159d59fe2d771f8eec43748dd869b Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-03 03:28:36 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-03 03:33:42 +0000 app-arch/cpio: fix build w/ clang 16 Closes: https://bugs.gentoo.org/880373 Signed-off-by: Sam James <sam@gentoo.org> .../{cpio-2.13-r4.ebuild => cpio-2.13-r5.ebuild} | 3 ++- ...2.13-wincompatible-function-pointer-types.patch | 23 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-)