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

Re: Inconsistencies in memory size types

Thread Previous | Thread Next
Aristotle Pagaltzis
June 23, 2016 09:42
Re: Inconsistencies in memory size types
Message ID:
* Josh Juran <> [2016-06-21 21:24]:
> On Jun 21, 2016, at 10:16 AM, (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.

Aristotle Pagaltzis // <>

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