Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 911753 - media-gfx/dcraw-9.28.0-r2 - parse.c: error: conflicting types for memmem; have char (char , size_t, char , size_t) {aka char (char
Summary: media-gfx/dcraw-9.28.0-r2 - parse.c: error: conflicting types for memmem; hav...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PullRequest
: 916672 (view as bug list)
Depends on:
Blocks: glibc-2.38 916586
  Show dependency tree
 
Reported: 2023-08-05 08:34 UTC by Toralf Förster
Modified: 2023-12-01 17:06 UTC (History)
9 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,19.73 KB, text/plain)
2023-08-05 08:34 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,134.60 KB, text/plain)
2023-08-05 08:34 UTC, Toralf Förster
Details
environment (environment,64.02 KB, text/plain)
2023-08-05 08:34 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,780 bytes, application/x-xz)
2023-08-05 08:34 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,16.95 KB, application/x-xz)
2023-08-05 08:34 UTC, Toralf Förster
Details
media-gfx:dcraw-9.28.0-r2:20230805-082556.log (media-gfx:dcraw-9.28.0-r2:20230805-082556.log,24.56 KB, text/plain)
2023-08-05 08:34 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,18.69 KB, application/x-xz)
2023-08-05 08:34 UTC, Toralf Förster
Details
Removes memmem from parse.c (dcraw_memmem.patch,560 bytes, patch)
2023-09-22 23:12 UTC, Robert Schultz
Details | Diff
build.log (build.log,44.49 KB, text/plain)
2023-11-01 09:34 UTC, Leonid Kopylov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2023-08-05 08:34:07 UTC
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
dcraw.c: In function foveon_interpolate:
dcraw.c:3443:26: note: at offset -132 into destination object of size [0, 786420] allocated by calloc
 3443 |   black = (float (*)[3]) calloc (height, sizeof *black);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * x86_64-pc-linux-gnu-gcc -O2 -O2 -pipe -march=native -fno-diagnostics-color -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0 -o dcparse parse.c
parse.c:968:7: error: conflicting types for memmem; have char *(char *, size_t,  char *, size_t) {aka char *(char *, long unsigned int,  char *, long unsigned int)}
  968 | char *memmem (char *haystack, size_t haystacklen,
      |       ^~~~~~

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

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_desktop_systemd-20230803-152005

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

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 16.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/16/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/16
16.0.6
Python 3.11.4
Available Rust versions:
  [1]   rust-bin-1.71.1
  [2]   rust-1.71.1 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 17.0.7_p7 [openjdk-bin-17]
*)	Eclipse Temurin JDK 8.372_p07 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8  system-vm
  [2]   openjdk-bin-17 

php cli (if any):
go version go1.20.6 linux/amd64

  HEAD of ::gentoo
commit 5828d75c7780d37d7567ce0a1719b551c7c48904
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sat Aug 5 07:31:37 2023 +0000

    2023-08-05 07:31:37 UTC

emerge -qpvO media-gfx/dcraw
[ebuild  N    ] media-gfx/dcraw-9.28.0-r2  USE="jpeg lcms nls -gimp"
Comment 1 Toralf Förster gentoo-dev 2023-08-05 08:34:08 UTC
Created attachment 867124 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2023-08-05 08:34:09 UTC
Created attachment 867125 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2023-08-05 08:34:10 UTC
Created attachment 867126 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2023-08-05 08:34:11 UTC
Created attachment 867127 [details]
etc.clang.tar.xz
Comment 5 Toralf Förster gentoo-dev 2023-08-05 08:34:12 UTC
Created attachment 867128 [details]
etc.portage.tar.xz
Comment 6 Toralf Förster gentoo-dev 2023-08-05 08:34:13 UTC
Created attachment 867129 [details]
media-gfx:dcraw-9.28.0-r2:20230805-082556.log
Comment 7 Toralf Förster gentoo-dev 2023-08-05 08:34:14 UTC
Created attachment 867130 [details]
temp.tar.xz
Comment 8 Robert Schultz 2023-09-22 23:12:34 UTC
Created attachment 871147 [details, diff]
Removes memmem from parse.c

Removing the memmem function from dcraw parse.c allows it to compile, since memmem is provided by glibc. Dunno if this is the "correct" solution, but, it works.
Comment 9 Andreas K. Hüttel archtester gentoo-dev 2023-10-28 16:19:39 UTC
(In reply to Robert Schultz from comment #8)
> Created attachment 871147 [details, diff] [details, diff]
> Removes memmem from parse.c
> 
> Removing the memmem function from dcraw parse.c allows it to compile, since
> memmem is provided by glibc. Dunno if this is the "correct" solution, but,
> it works.

That's not really a good solution since then dcraw fails to build with older glibc ...

The solution in the PR is better (adapting the return type of memmem).
Comment 10 Larry the Git Cow gentoo-dev 2023-10-31 19:35:00 UTC
The bug has been closed via the following commit(s):

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

commit 6172f7056a106ec032d333e1c0b3eb64af5813a2
Author:     Pascal Jäger <pascal.jaeger@leimstift.de>
AuthorDate: 2023-09-22 11:26:39 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2023-10-31 19:27:34 +0000

    media-gfx/dcraw: revbump, fix bugs
    
    Closes: https://bugs.gentoo.org/713220
    Closes: https://bugs.gentoo.org/896204
    Closes: https://bugs.gentoo.org/911753
    Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
    Closes: https://github.com/gentoo/gentoo/pull/32990
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 media-gfx/dcraw/dcraw-9.28.0-r3.ebuild             | 130 +++++++++++++++++++++
 .../dcraw-9.28.0-fix-LC_CTYPE-undeclared.patch     |  17 +++
 ...dcraw-9.28.0-fix-memmem-wrong-return-type.patch |  17 +++
 3 files changed, 164 insertions(+)
Comment 11 Klaus Kusche 2023-11-01 09:24:34 UTC
Please reopen, the bug is *not* fixed with that commit
(at least, I just got the same error when emerging dcraw-9.28.0-r3).

The problem with memmem in parse.c is not only the return type:
The *argument* types are conflicting and causing the error:

The memmem in parse.c has type "char *" for the first and third argument.
The memmem in the system string.h declares them both as "const void *"
(and "const void *" is correct).
Comment 12 Leonid Kopylov 2023-11-01 09:33:34 UTC
media-gfx/dcraw-9.28.0-r3 also fails to build
Comment 13 Leonid Kopylov 2023-11-01 09:34:30 UTC
Created attachment 873809 [details]
build.log
Comment 14 Jan Psota 2023-11-03 09:44:50 UTC
Removing memmem() from parse.c resolves the problem (and I checked it before looking here). Make use of the new patch by Robert Schultz and close that bug! :-)

@Leonid Kopylov - make use of that /usr/local/bin/decolor
#!/bin/sed -f
s:\x1B\[[0-9;]*[mK]::g

to get rid of ncurses special codes.
Comment 15 Andreas Sturmlechner gentoo-dev 2023-11-03 09:53:40 UTC
*** Bug 916672 has been marked as a duplicate of this bug. ***
Comment 16 Ben Kohler gentoo-dev 2023-11-04 12:41:24 UTC
This patch from SUSE may help:
https://build.opensuse.org/package/view_file/openSUSE:Factory/dcraw/dcraw-glibc-2.38.patch

Needs to be adapted to coexist with our existing memmem patch.
Comment 17 Larry the Git Cow gentoo-dev 2023-11-04 12:43:46 UTC
The bug has been referenced in the following commit(s):

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

commit eefddc92a4e972321eefd80796fd4cfdd6ca9b67
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2023-11-04 12:43:04 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2023-11-04 12:43:40 +0000

    media-gfx/dcraw: fix build for glibc-2.38
    
    Bug: https://bugs.gentoo.org/911753
    
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 media-gfx/dcraw/dcraw-9.28.0-r4.ebuild             | 130 +++++++++++++++++++++
 .../dcraw/files/dcraw-9.28.0-glibc-2.38.patch      |  24 ++++
 2 files changed, 154 insertions(+)