Sujet : Re: question about nullptr
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 26. Aug 2024, 04:46:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vagtqj$2ahdn$2@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla Thunderbird
On 8/25/24 16:55,
dave_thompson_2@comcast.net wrote:
On Mon, 15 Jul 2024 19:49:08 -0400, James Kuyper
<jameskuyper@alumni.caltech.edu> wrote:
>
On 7/15/24 18:51, Lawrence D'Oliveiro wrote:
[silliness]
Keep in mind that, in text mode, the <stdio.h> library routines use '\n'
in memory to represent whatever platform-specific method is used in
files to indicate a new line. For example, that can be a simple '\n' on
typical Unix-like machines, '\n\r' or '\r\n' on other operating systems,
and on a number of older systems, it could be converted to and from a
fixed-size block with a character count at the the beginning of the
block. There's no requirement that it be the Unicode line feed character.
>
I never knew any older system that used a fixed-size block (or rather
record, which in those days was not the same as block) AND prefix
count in the same file, although OS/360 et seq used ONE of them.
>
And Tandem Enscribe used either offset or count fields (depending on
structure) at _end_ of block, near but not adjacent to records, except
for textfiles had prefix counts per line AND word (of nonblanks) --
but the initial versions of their C implementation couldn't handle
textfiles, so you had to convert them to and from 'data'.
It's been a long time since I ever worked with systems that supported
such formats, and I never had to actually work with such formats, so I
don't really know a lot about them. I've figured out four different
schemes whereby a system using a fixed block size could keep track of
whether or not a text line stops inside the block, and if so, where; but
I'm not sure what methods were actually used, nor which systems used
them - but for me, the important point about all of those schemes is
that what the C standard fails to mandate about such things allows a
conforming implementation of C to use any one of them.
For most of my career as a programmer, I worked under requirements that
my code behave as intended on any hosted conforming implementation of C.
Since we didn't have any systems that used obscure line-ending methods
in shop, whether my code would have worked on such an implementation was
untested, but it was intended to.