develooper Front page | perl.perl5.porters | Postings from June 2016

Re: Inconsistencies in memory size types

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
June 23, 2016 09:42
Subject:
Re: Inconsistencies in memory size types
Message ID:
20160623094208.GA42384@plasmasturm.org
* Josh Juran <jjuran@gmail.com> [2016-06-21 21:24]:
> On Jun 21, 2016, at 10:16 AM, ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) wrote:
> > Any more votes the merits of (S)Size_t vs. (s)size_t?
>
> All other things being equal, I'd encourage using standard types over
> equivalent non-standard types.

Same here.

To me it seems the most sensible approach to portability is the OpenBSD
way: write the code to a reasonable baseline, then polyfill the missing
bits of each platform with the portability layer.

Meaning, in perl’s case, Configure must probe for a sane ssize_t, and on
platforms where it doesn’t find one, config.h must provide a reasonable
fallback definition (i.e. whatever SSize_t would be on those platforms
now, presumably). Then perl can use size_t/ssize_t like any conventional
C project.

That way, the portability concerns are isolated in one place, instead of
leaking out across the entirety of the codebase.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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