Liste des Groupes | Revenir à cl c |
antispam@fricas.org (Waldek Hebisch) writes:This is 'making assumptions' when the code is subsequently run on a different platform.bart <bc@freeuk.com> wrote:On 21/03/2025 17:51, Waldek Hebisch wrote:bart <bc@freeuk.com> wrote:ssize_t existed in before 1990 (in SVR4). intptr_t came later.(Probably intptr_t or ssize_t is better for>
that purpose, and will be portable between Windows and Linux.)
Those did not exist in 1991 and would be needed only for small
machines. Except for Microsoft which decided to push its own,
different way.
$ grep ssize_t common/head/*
common/head/aio.h: ssize_t aio__return; /* operation result value */
common/head/unistd.h:extern ssize_t read(int, void *, size_t);
common/head/unistd.h:extern ssize_t write(int, const void *, size_t);
Programmers shouldn't be making 'assumptions' in the first place.One 'con' for Linux' approach is when someone assumes 'long' is i32;>
when they run code on 64 bits, it will either be wasteful, or it could
go badly wrong.
One 'con' of any assumption is that somebody can make a different
assumption.
The architectural ABI describes fully the capabilities of the
native types. If the programmer isn't aware of that, they
shouldn't be programming.
Les messages affichés proviennent d'usenet.