Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 883313 - media-libs/gegl-0.4.40 build failure with clang-15 -Werror=strict-prototypes
Summary: media-libs/gegl-0.4.40 build failure with clang-15 -Werror=strict-prototypes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergey Torokhov
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: c23-porting
  Show dependency tree
 
Reported: 2022-11-27 15:35 UTC by Carlos
Modified: 2022-12-22 00:24 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,538.81 KB, text/x-log)
2022-11-27 15:36 UTC, Carlos
Details
patch adding (void) to prototypes where needed (strict-proto.patch,2.62 KB, patch)
2022-11-27 15:38 UTC, Carlos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos 2022-11-27 15:35:37 UTC
Several functions in ctx.h have two prototypes, one with `function ()` and the other with `function (type a, type b)`. The first declaration causes a build failure with stricter Clang 15.

../gegl-0.4.40/operations/common/ctx/ctx.h:6050:25: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
CtxColor *ctx_color_new ();
                        ^
                         void
../gegl-0.4.40/operations/common/ctx/ctx.h:11084:28: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void ctx_font_setup ();
                           ^
                            void
../gegl-0.4.40/operations/common/ctx/ctx.h:11084:13: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent declaration [-Werror,-Wdeprecated-non-prototype]
static void ctx_font_setup ();
            ^
../gegl-0.4.40/operations/common/ctx/ctx.h:51701:13: note: conflicting prototype is here
static void ctx_font_setup (Ctx *ctx);
            ^

Reproducible: Always

Steps to Reproduce:
1. Add -Werror=strict-prototypes to CFLAGS
2. Emerge GEGL


Expected Results:  
Successful build

Portage 3.0.39 (python 3.10.8-final-0, default/linux/amd64/17.0/musl, [unavailable], musl-1.2.3-r5, 6.0.7-xanmod1 x86_64)
=================================================================
System uname: Linux-6.0.7-xanmod1-x86_64-Intel-R-_Core-TM-_i7-8565U_CPU_@_1.80GHz-with-libc
KiB Mem:     7978972 total,   2877052 free
KiB Swap:    4194300 total,   4194300 free
Head commit of repository gentoo: 5427d6eeca8fccf5eb2005e99d4bb4f804a101d1

Head commit of repository 12101111-overlay: 371396bca7084c6dd9b3f4460f429207fe29acc7

Head commit of repository clang-musl: dc74e778beddd05263eb350208fee8cae8a52644

Timestamp of repository dm9pZCAq: Fri, 25 Nov 2022 15:46:49 +0000
Head commit of repository dm9pZCAq: fff4889810297fa6db9e80ff9814496035a89781

Timestamp of repository gentoobr: Thu, 10 Nov 2022 20:06:18 +0000
Head commit of repository gentoobr: 607beb884b86e552cb7608e8eb9eedf0c7868205

Timestamp of repository guru: Wed, 23 Nov 2022 01:38:02 +0000
Head commit of repository guru: 86a2bac9e60c7f1958df39e597d8e81389b0bca5

Head commit of repository tlp: 4ba9fce0927a4bc87a4df54eb352a163a439810e

Head commit of repository yago: e2f94ed97494704754b258e2d525dfb36a4458ca

sh dash 0.5.11.5
ld LLD 15.0.5 (compatible with GNU linkers)
app-misc/pax-utils:       1.3.5::gentoo
app-shells/bash:          5.2_p12::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.36.0-r1::gentoo
dev-lang/python:          3.10.8_p3::gentoo
dev-lang/rust:            1.65.0::clang-musl
dev-util/cmake:           3.25.0::gentoo
dev-util/meson:           0.64.1::gentoo
sys-apps/baselayout:      2.9::gentoo
sys-apps/sandbox:         2.29::gentoo
sys-devel/autoconf:       2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:       1.16.5::gentoo
sys-devel/clang:          14.0.6-r1::gentoo, 15.0.5::gentoo
sys-devel/libtool:        2.4.7::gentoo
sys-devel/lld:            14.0.6-r1::gentoo, 15.0.5::gentoo
sys-devel/llvm:           14.0.6-r2::12101111-overlay, 15.0.5::clang-musl
sys-devel/make:           4.4::gentoo
sys-kernel/linux-headers: 6.0::gentoo (virtual/os-headers)
sys-libs/musl:            1.2.3-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: -1000

12101111-overlay
    location: /var/db/repos/12101111-overlay
    sync-type: git
    sync-uri: https://github.com/12101111/overlay/
    masters: gentoo

clang-musl
    location: /var/db/repos/clang-musl
    sync-type: git
    sync-uri: https://github.com/clang-musl-overlay/clang-musl-overlay
    masters: gentoo

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo

dm9pZCAq
    location: /var/db/repos/dm9pZCAq
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/dm9pZCAq.git
    masters: gentoo

gentoobr
    location: /var/db/repos/gentoobr
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoobr.git
    masters: gentoo

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

tlp
    location: /var/db/repos/tlp
    sync-type: git
    sync-uri: https://github.com/dywisor/tlp-portage
    masters: gentoo

yago
    location: /var/db/repos/yago
    sync-type: git
    sync-uri: file://home/carlos/Build/yago
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
AR="llvm-ar"
CBUILD="x86_64-gentoo-linux-musl"
CC="clang"
CFLAGS="-march=skylake -mtune=skylake -O3 -pipe -Werror=strict-prototypes -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types -flto=thin -mllvm -polly -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/lib/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CPP="x86_64-gentoo-linux-musl-clang-cpp"
CXX="clang++"
CXXFLAGS="-march=skylake -mtune=skylake -O3 -pipe -Werror=strict-prototypes -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types -flto=thin -mllvm -polly -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --quiet=y --buildpkg --buildpkg-exclude='virtual/* sys-kernel/*-sources */*-bin'"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=skylake -mtune=skylake -O3 -pipe -Werror=strict-prototypes -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types -flto=thin"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=skylake -mtune=skylake -O3 -pipe -Werror=strict-prototypes -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types -flto=thin"
GENTOO_MIRRORS="https://gentoo.c3sl.ufpr.br/"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="pt_BR.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now"
MAKEOPTS="-j6 -l6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="zstd"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/run/"
RUSTFLAGS="-Ctarget-cpu=skylake -Copt-level=3 -Cllvm-args=-polly -Clinker=clang -Clinker-plugin-lto=yes -Clink-arg=-flto=thin -Clink-arg=-Wl,--as-needed"
SHELL="/bin/bash"
USE="X acl alsa amd64 apng bash-completion basu bluetooth bzip2 cairo clang cli compiler-rt crypt cups dbus default-compiler-rt default-libcxx default-lld dri drm egl ffmpeg fontconfig fortran gif gles2 gme harfbuzz heif hwaccel iconv icu ipv6 jpeg jpeg2k libcxx libcxxabi libglvnd libsamplerate libtirpc lld llvm-libunwind lto lz4 lzma lzo mp3 ncurses nls nptl opengl openmp openssl opus pam pango pcre perl png pt pulseaudio python readline screencast seccomp split-usr ssl test-rust theora threads tiff tk truetype unicode v4l vaapi vorbis vpx vulkan wayland webp x264 x265 x86_64 xattr zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="wacom" KERNEL="linux" L10N="pt pt-BR" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX X86 AArch64 ARM AVR Hexagon Lanai MSP430 Mips PowerPC RISCV Sparc SystemZ VE WebAssembly XCore" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="x86_64 i386 aarch64 aarch64_be arm riscv32 riscv64" QEMU_USER_TARGETS="aarch64 aarch64_be arm riscv32 riscv64" RUBY_TARGETS="ruby27" SANE_BACKENDS="epson epson2" USERLAND="GNU" VIDEO_CARDS="intel i965 amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, ARFLAGS, AS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

[ebuild   R    ] media-libs/gegl-0.4.40:0.4::gentoo  USE="cairo openmp tiff v4l webp -debug -ffmpeg -introspection -lcms -lensfun -openexr -pdf -raw -sdl -sdl2 -svg -test -umfpack -vala" 0 KiB
Comment 1 Carlos 2022-11-27 15:36:30 UTC
Created attachment 837737 [details]
build.log
Comment 2 Carlos 2022-11-27 15:38:01 UTC
Created attachment 837739 [details, diff]
patch adding (void) to prototypes where needed

Signed-off-by: Carlos Eduardo (carana2099@gmail.com)
Comment 3 Ionen Wolkens gentoo-dev 2022-11-27 20:46:13 UTC
There's not really a need to fix missing (void) because not specifying it is set to become valid in C2x (aka clang -std=gnu2x -Werror=strict-prototypes doesn't error out with a `int main() { return 0; }`, but e.g. -std=gnu99 does).

It's a subset of strict-prototypes that's an issue and will be broken in C2x (-Werror=deprecated-non-prototype) unless an older -std= is passed making it a non-issue.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-27 23:32:51 UTC
It's worth fixing these once you hit them just to avoid more reports like this but indeed no need to do it proactively (we've dropped strict-prototypes from stricter mode for Clang 15 because of the problems ionen described). Would you mind sending this upstream too?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-28 00:39:38 UTC
Thank you!
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-01 06:49:02 UTC
(I'll add c23-porting blocker as it's close enough.)
Comment 7 Larry the Git Cow gentoo-dev 2022-12-21 23:52:09 UTC
The bug has been closed via the following commit(s):

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

commit 1b67509015dbe51f15a0c7d3f4c316826dc927de
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-12-21 23:46:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-12-21 23:52:00 +0000

    media-libs/gegl: fix -Wstrict-prototypes
    
    Signed-off-by: Carlos Eduardo <carana2099@gmail.com>
    Closes: https://bugs.gentoo.org/883313
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gegl/files/gegl-0.4.40-strict-prototypes.patch | 79 ++++++++++++++++++++++
 media-libs/gegl/gegl-0.4.40-r1.ebuild              |  4 ++
 2 files changed, 83 insertions(+)
Comment 8 Sergey Torokhov 2022-12-22 00:24:30 UTC
Sam James,
thank you for fix the ebuild