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

Re: Perl 7: Fix string leaks?

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
April 1, 2021 16:38
Subject:
Re: Perl 7: Fix string leaks?
Message ID:
CAHhgV8ghn7qqT=29ZtOOjb3+KewiKZ7yOVuVFhaio+F2b6PNXA@mail.gmail.com
On Thu, Apr 1, 2021 at 6:20 PM Felipe Gasper <felipe@felipegasper.com> wrote:
>
>
> > On Apr 1, 2021, at 12:17 PM, B. Estrade <brett@cpanel.net> wrote:
> >
> > On 4/1/21 11:01 AM, Leon Timmermans wrote:
> >> On Wed, Mar 31, 2021 at 7:04 PM Salvador Fandiño <sfandino@gmail.com> 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.
> >>>
> >>> You can make it warn just the first time it happens globally, of just
> >>> the first time if happens at some call point.
> >> That would just create a lot of warnings for people who can't do much
> >> about it as the vast majority of users can't do XS.
> >
> > Considering this is tantamount to "recompiling the [module] kernel", yeah. Maybe something of an XS linter tool or special class of defines available via a Makefile.PL.debug that can be put int ./xt if one were to init an XS module using h2xs? Idk, just thinking in the area of XS development toolchain.
>
> Certainly it’d be nice if xsubpp could warn--however loudly--when something uses the default `char*` and `const char*` typemaps. I took a gander a few days back at that but didn’t get very far with it.

I guess that adding such a warning is best done in the typemap for
char* (lib/ExtUtils/typemap)

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About