On Thu, Feb 19, 2026 at 05:40:38PM +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.
I do not think that it would be right, as it is more correct to use the Perl-compatible functions in that file, not the Gnulib-compatible ones, as the memory allocated with strndup in that file is free'd right after without going through Gnulib headers including code. It would probably work ok if done consistently, but I think that the resulting code would be somewhat confusing. > At this stage, I'm actually slightly concerned about adding new include > directives to files and worry it could cause breakage due to the wrong > definitions being used, files being included in the wrong order, or whatever. > I don't want to do another pretest as it has already been tested enough > and we are hardly making any changes now, and it's a burden on interested > users who want to help test the pretests. > > I notice that convert/call_conversion_perl.c does not include any system > include files either and yet it uses fprintf and size_t, at least. Yet > there have been no reports of errors. Evidently the correct header files > are being included indirectly. > > I suggest that we can fix these files so they include the right headers > immediately after the release. I already committed added include for the tta/C/convert/call_html_perl_function.c file but it could be reverted. I do not think that there is much risk given that the includes are already similarly set in other similar files as I said above. -- Pat
