Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 878283

Summary: media-sound/deadbeef-1.9.2 - cdda.c: error: incompatible function pointer types initializing
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Piotr Karbowski (RETIRED) <slashbeast>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/DeaDBeeF-Player/deadbeef/issues/2879
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 870412    
Attachments: emerge-info.txt
emerge-history.txt.bz2
environment
etc.portage.tar.bz2
logs.tar.bz2
media-sound:deadbeef-1.9.2:20221024-215121.log
temp.tar.bz2

Description Toralf Förster gentoo-dev 2022-10-25 17:48:27 UTC
      'char *' converts between pointers to integer types where one is of the
      unique plain 'char' type and the other is not [-Wpointer-sign]
    info->tail = (char *)p_readbuf + offset;
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
cdda.c:1010:18: error: incompatible function pointer types initializing
      'DB_plugin_action_callback2_t' (aka 'int (*)(struct DB_plugin_action_s *,
      enum ddb_action_context_e)') with an expression of type 'int

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop-j4-20221021-220006

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-11
 [2] x86_64-pc-linux-gnu-12 *
clang/llvm (if any):
clang version 15.0.3
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.3
Python 3.10.8
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby31 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.64.0 *
The following VMs are available for generation-2:
1)	OpenJDK 17.0.5_p5 [openjdk-17]
*)	Eclipse Temurin JDK 17.0.4.1_p1 [openjdk-bin-17]
3)	Eclipse Temurin JDK 8.345_p01 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-17 
  [2]   openjdk-bin-8 
  [3]   openjdk-bin-17  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):
GNU Make 4.3

  HEAD of ::gentoo
commit 0aca396169f4931c89f9d770d72c9495ba2a6366
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Mon Oct 24 21:01:56 2022 +0000

    2022-10-24 21:01:55 UTC

emerge -qpvO media-sound/deadbeef
[ebuild  N    ] media-sound/deadbeef-1.9.2  USE="aac alsa cdda dts flac hotkeys mp3 nls nullout supereq vorbis -converter -cover -ffmpeg -lastfm -libsamplerate -musepack -notify -opus -oss -pulseaudio -sc68 -shellexec -threads -wavpack"
Comment 1 Toralf Förster gentoo-dev 2022-10-25 17:48:28 UTC
Created attachment 825325 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-10-25 17:48:30 UTC
Created attachment 825327 [details]
emerge-history.txt.bz2
Comment 3 Toralf Förster gentoo-dev 2022-10-25 17:48:31 UTC
Created attachment 825329 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-10-25 17:48:32 UTC
Created attachment 825331 [details]
etc.portage.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-10-25 17:48:33 UTC
Created attachment 825333 [details]
logs.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-10-25 17:48:35 UTC
Created attachment 825335 [details]
media-sound:deadbeef-1.9.2:20221024-215121.log
Comment 7 Toralf Förster gentoo-dev 2022-10-25 17:48:36 UTC
Created attachment 825337 [details]
temp.tar.bz2
Comment 8 Piotr Karbowski (RETIRED) gentoo-dev 2022-10-25 20:46:32 UTC
I'd appreciate some help to reproduce this one. Building with USE=cdda does not crash here like that, and I do also run clang-15.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-25 20:52:54 UTC
(In reply to Piotr Karbowski from comment #8)
> I'd appreciate some help to reproduce this one. Building with USE=cdda does
> not crash here like that, and I do also run clang-15.

Do you get the warning for -Wincompatible-function-pointer-types with Clang 15? It becomes _fatal_ in 16 but I'd expect it to show up with 15, just as a warning (so easy to miss).
Comment 10 Piotr Karbowski (RETIRED) gentoo-dev 2022-10-25 21:01:51 UTC
It indeed is the case, there's 

cdda.c:1010:18: warning: incompatible function pointer types initializing 'DB_plugin_action_callback2_t' (aka 'int (*)(struct DB_plugin_action_s *, enum
      ddb_action_context_e)') with an expression of type 'int (DB_plugin_action_t *, int)' (aka 'int (struct DB_plugin_action_s *, int)') [-Wincompatible-function-pointer-types]
    .callback2 = cda_action_add_cd,
                 ^~~~~~~~~~~~~~~~~
cdda.c:1067:39: warning: incompatible function pointer types assigning to 'DB_plugin_action_callback2_t' (aka 'int (*)(struct DB_plugin_action_s *, enum
      ddb_action_context_e)') from 'int (DB_plugin_action_t *, int)' (aka 'int (struct DB_plugin_action_s *, int)') [-Wincompatible-function-pointer-types]
            disc_actions[i].callback2 = action_disc_n;
                                      ^ ~~~~~~~~~~~~~


I will take it to upstream, however where does those Werror comes from? the attached /etc/portage and emerge --info does not have any indication of those being enabled and if they were from build system I should hit it as well.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-25 21:24:05 UTC
It becomes default in Clang 16, it's kind of confusing output, but you're right, it's *clang* setting it, not the build system at all, so don't worry about that side.

Thanks for forwarding upstream!
Comment 12 Piotr Karbowski (RETIRED) gentoo-dev 2022-10-26 09:57:22 UTC
@Toralf how do you enable those to be errors on clang-15? Upstream made fix, and I seems to have the exact same build environment as you lists here (clang-15), I'd like to test it before confirming its all good and closing this bug.

I think others could also use the information how to reproduce those errors, other than greping for warnings in build.log that is.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-26 11:04:29 UTC
(In reply to Piotr Karbowski from comment #12)
> @Toralf how do you enable those to be errors on clang-15? Upstream made fix,
> and I seems to have the exact same build environment as you lists here
> (clang-15), I'd like to test it before confirming its all good and closing
> this bug.
> 
> I think others could also use the information how to reproduce those errors,
> other than greping for warnings in build.log that is.

Option 1: USE=stricter on sys-devel/clang-runtime
Option 2 (it's related to option 1): see https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240 & https://blogs.gentoo.org/mgorny/2022/10/07/clang-in-gentoo-now-sets-default-runtimes-via-config-file/
Option 3: manually set CFLAGS="... -Werror=..."
Comment 14 Piotr Karbowski (RETIRED) gentoo-dev 2022-10-26 11:17:17 UTC
Thanks, will now test it and backport the fix.
Comment 15 Larry the Git Cow gentoo-dev 2022-10-26 19:13:31 UTC
The bug has been closed via the following commit(s):

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

commit d4b5c9b47c92862b1f6427327b822840b80837b0
Author:     Piotr Karbowski <slashbeast@gentoo.org>
AuthorDate: 2022-10-26 19:12:32 +0000
Commit:     Piotr Karbowski <slashbeast@gentoo.org>
CommitDate: 2022-10-26 19:13:28 +0000

    media-sound/deadbeef: 1.9.2-r1: backport of clang-16 fixes.
    
    Closes: https://bugs.gentoo.org/878283
    Signed-off-by: Piotr Karbowski <slashbeast@gentoo.org>

 ...dbeef-1.9.2.ebuild => deadbeef-1.9.2-r1.ebuild} |  1 +
 ...deadbeef-1.9.2-cdda-plugin-clang-16-fixes.patch | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)