On Thu, Feb 19, 2026 at 05:40:40PM +0000, Gavin Smith wrote:
> On Thu, Feb 19, 2026 at 05:17:11PM +0100, Patrice Dumas wrote:
> > Maybe strndup is not defined/redefined by Perl at all, then.  In that
> > case, maybe a solution could be to use our own Perl-compatible strndup
> > implementation, which is the perl_only_strndup function.  I think that
> > the use of strndup in C code built against Perl headers is quite new, it
> > is possible that we never had code like that before.
> 
> It should be easy to avoid using strndup in favour of more standard functions
> in the code that includes the Perl headers.
> 
> We use our own function non_perl_strndup in numerous places in this file;
> would we not just use that in this one place where strndup occurs intead?
> That should silence the warning that Eli reported.

Oh, it's not that simple, as the result is passed to 'free' in the same file.

It should be easy to replace the strndup call with malloc and memcpy.

Reply via email to