Bug#1075185: libmemcached-libmemcached-perl: ftbfs with GCC-14

Niko Tyni ntyni at debian.org
Mon Aug 5 09:54:31 BST 2024


On Sun, Jul 21, 2024 at 08:31:48PM +0200, Étienne Mollier wrote:
 
> From my current analysis, the relevant error is below:
> 
> > libmemcached.c:4613:23: error: assignment to ‘I32’ {aka ‘int’} from ‘char *’
> >                                makes integer from pointer without a cast [-Wint-conversion]
> >  4613 |         XSANY.any_i32 = MEMCACHED_DEFAULT_PORT_STRING ;
> >       |                       ^
> 
> It looks to stem from the fact that Perl XS expects the
> MEMCACHED_DEFAULT_PORT_STRING to be an int.  I'm not sure what
> triggers that code path.  For what it's worth the variable seems
> to be defined as a string in the embedded copy at the location
> debian/libmemcached/lib/Memcached/libmemcached/const_hash.pl:

Yes, I think MEMCACHED_DEFAULT_PORT_STRING has always had a type mismatch.
With the current sid package:

# perl -MMemcached::libmemcached=:defines  -E 'say for (MEMCACHED_DEFAULT_PORT, MEMCACHED_DEFAULT_PORT_STRING)'
11211
-2128759247

The latter varies on each run as it's just the pointer to the underlying
string. It's clearly quite useless.

A quick fix is to remove MEMCACHED_DEFAULT_PORT_STRING from the
bundled debian/libmemcached/const-xs.inc. That makes the build pass for
me. Presumably the files in debian/libmemcached/lib/Memcached/libmemcached
would need a similar change to keep the documentation etc. in sync.

However, I wonder if we should really regenerate const-xs.inc et al. with
the Makefile.PL machinery on each build rather than use the hardcoded
list. I see the packaging has been this way from the start, but AFAICS
extract_libmemcached_functions() and extract_libmemcached_constants()
(which we're currently patching out) should work just fine with the
system headers too.

That would require special casing MEMCACHED_DEFAULT_PORT_STRING or
adding logic to skip string constants or whatever, but it would
seem cleaner to me.

But I guess that's a separate bug. Hope this helps anyway.

Thanks for looking at this,
-- 
Niko



More information about the pkg-perl-maintainers mailing list