Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880373 - app-arch/cpio-2.13-r3 - obstack.c: error: incompatible function pointer types initializing void
Summary: app-arch/cpio-2.13-r3 - obstack.c: error: incompatible function pointer types...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard: fixed in 2.13-r5
Keywords: PATCH
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2022-11-08 09:31 UTC by Toralf Förster
Modified: 2024-10-28 19:43 UTC (History)
0 users

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


Attachments
emerge-info.txt (emerge-info.txt,17.08 KB, text/plain)
2022-11-08 09:31 UTC, Toralf Förster
Details
app-arch:cpio-2.13-r3:20221108-092752.log (app-arch:cpio-2.13-r3:20221108-092752.log,86.81 KB, text/plain)
2022-11-08 09:31 UTC, Toralf Förster
Details
clang.tar.bz2 (clang.tar.bz2,4.66 KB, application/x-bzip)
2022-11-08 09:31 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,29.38 KB, text/plain)
2022-11-08 09:31 UTC, Toralf Förster
Details
environment (environment,77.52 KB, text/plain)
2022-11-08 09:31 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,22.63 KB, application/x-bzip)
2022-11-08 09:31 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,36.20 KB, application/x-bzip)
2022-11-08 09:31 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,38.34 KB, application/x-bzip)
2022-11-08 09:31 UTC, Toralf Förster
Details
Change C11 _Noreturn into __attribute__((noreturn)) in obstack.c (file_880373.txt,391 bytes, patch)
2022-12-01 01:03 UTC, Carlos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-11-08 09:31:18 UTC
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"
Comment 1 Toralf Förster gentoo-dev 2022-11-08 09:31:19 UTC
Created attachment 828957 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-11-08 09:31:21 UTC
Created attachment 828959 [details]
app-arch:cpio-2.13-r3:20221108-092752.log
Comment 3 Toralf Förster gentoo-dev 2022-11-08 09:31:21 UTC
Created attachment 828961 [details]
clang.tar.bz2
Comment 4 Toralf Förster gentoo-dev 2022-11-08 09:31:22 UTC
Created attachment 828963 [details]
emerge-history.txt
Comment 5 Toralf Förster gentoo-dev 2022-11-08 09:31:24 UTC
Created attachment 828965 [details]
environment
Comment 6 Toralf Förster gentoo-dev 2022-11-08 09:31:25 UTC
Created attachment 828967 [details]
etc.portage.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2022-11-08 09:31:26 UTC
Created attachment 828969 [details]
logs.tar.bz2
Comment 8 Toralf Förster gentoo-dev 2022-11-08 09:31:27 UTC
Created attachment 828971 [details]
temp.tar.bz2
Comment 9 Carlos 2022-12-01 01:03:16 UTC
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.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-01 01:18:30 UTC
(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!
Comment 11 Mazunki Hoksaas 2022-12-01 12:27:30 UTC
The patch compiles on both my clang and my gcc environment. Both with LTO.
Comment 12 Larry the Git Cow gentoo-dev 2023-01-03 03:33:48 UTC
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(-)