Open thesamesam opened 11 months ago
This is an issue with CDK I would say.
cdk-devel-5.0.20230201-1.1.x86_64 on openSUSE tumbleweed: /usr/include/cdk/cdk_config.h:#define CDK_CSTRING2 CDK_CONST char CDK_CONST
In older CDK 4.9.13 it was char**, so CDK changes its prototypes.
I could add a configure check, but perhaps you can update cdk to version 5?
or we enforce use of cdk >= 5
huh, interestingly, we only have these versions..
5.0.20210324-r2, 5.0.20221025, 5.0.20230201
let me see if a configure test got confused..
check cdk_config.h too on your side.
ok, my cdk_config.h has:
[...]
#define CDK_CONST /*nothing*/
#define CDK_CSTRING CDK_CONST char *
#define CDK_CSTRING2 CDK_CONST char * CDK_CONST *
[...]
configure for gphoto2 says:
checking for cdk/cdk.h... no
checking for cdk.h... yes
checking for cdk5-config... /usr/bin/cdk5-config
checking for newCDKFScale in -lcdk... no
config.h says for gphoto2 says:
/* whether we have old CDK */
#define HAVE_CDK_20010421 1
looking more..
jwakely kindly tested for me on Fedora and shared their cdk_config.h
as well.
Diffing the two:
$ diff -ruN /tmp/good /usr/include/cdk/cdk_config.h
--- /tmp/good 2023-12-06 15:48:25.136119401 +0000
+++ /usr/include/cdk/cdk_config.h 2023-12-06 12:43:56.528424776 +0000
@@ -7,7 +7,7 @@
#define CDK_CONFIG_H 1
-#define CDK_CONST const
+#define CDK_CONST /*nothing*/
#define CDK_CSTRING CDK_CONST char *
#define CDK_CSTRING2 CDK_CONST char * CDK_CONST *
#define CDK_PATCHDATE 20230201
@@ -44,6 +44,7 @@
#define CDK_HAVE_TYPE_CHTYPE 1
#define CDK_HAVE_UNCTRL_H 1
#define CDK_HAVE_UNISTD_H 1
+#define CDK_HAVE_WCHAR_H 1
#define CDK_MIXEDCASE_FILENAMES 1
#define CDK_NCURSES 1
#define CDK_PACKAGE "cdk"
It turns out Fedora (and openSUSE) builds cdk with --enable-const
. If I use that, then everything is fine.
So, this is PEBKAC to an extent, and I'll fix our package for cdk in Gentoo now. Up to you if you think configure for gphoto2 should check for this. Thank you for the help!
FWIW its not a super state of cdk being API flexible this way.
i replaced "const" by CDK_CONST in the affected places now, this might help with both variants.
Describe the bug
Modern C compilers are becoming stricter with a variety of changes over the last year or so.
GCC 14 in particular (to be released in ~April 2024) fails to build gphoto2-2.2.58 like:
Originally reported downstream in Gentoo at https://bugs.gentoo.org/919279.
Name the camera N/A
libgphoto2 and gphoto2 version libgphoto2-2.5.1, gphoto2-2.5.28
To Reproduce Steps to reproduce the behavior: This can be emulated with
-Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion
on an older GCC or Clang.Similar to https://github.com/gphoto/libgphoto2/issues/941.