develooper Front page | perl.perl5.porters | Postings from April 2021

Re: Perl 7: Fix string leaks?

Thread Previous | Thread Next
Ben Bullock
April 1, 2021 01:24
Re: Perl 7: Fix string leaks?
Message ID:
On Wed, 31 Mar 2021 at 21:40, Felipe Gasper <> wrote:

> > Anyway, if you want a more conservative approach you can also make
> > a version of SvPV (say SvPV_bad) that warns on first use and
> > change the default typemaps to use it.

> I would love to take an approach like this, but I think it would
> create too many warnings in code that currently “happens” to work
> consistently.
> I *do* think that SvPV should be renamed to SvPVinternal, or some such.

Your justification would be avoiding errors around Unicode bytes?

Changing the typemap would undoubtedly break things, but disabling
SvPV will break probably more than half the XS modules on CPAN,
including ones which use SV* to store binary data such as PNG images
or encrypted data, where the issue about upgrading and downgrading
Unicode bytes is irrelevant. The same goes for adding warnings and so

If SvPV or the default typemap for char * are to be avoided by
programmers, the first step is to document that in perlapi and perlxs
(the documentation). At the moment such documentation does not

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About