From: Steve Nickolas <usotsuki@buric.co>
To: John Cowan <cowan@ccil.org>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] reviving a bit of WWB
Date: Mon, 21 Sep 2020 17:39:42 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.2.21.2009211732330.13076@sd-119843.dedibox.fr> (raw)
In-Reply-To: <CAD2gp_T=RjQkrFeaeu-e4b4qvQFa-uZWTgg6mBiOJhF5fJh9qw@mail.gmail.com>
On Mon, 21 Sep 2020, John Cowan wrote:
> On Mon, Sep 21, 2020 at 1:55 AM Steve Nickolas <usotsuki@buric.co> wrote:
>
>
>> I've never written anything that uses varargs, so I've never run into
>> that. But I've actually done quite a bit of work with an environment
>> where this isn't true: MS-DOS using the large or huge model. In this
>> environment, sizeof(int)=2, and sizeof(void*) is 4. Of course, it's not
>> conformant to pass an int variable as an argument where a pointer variable
>> is expected.
>>
>
> If the compiler was ISO-conformant (which it almost certainly was not),
> that would not matter. 0 in int context would be a 2-byte int with all
> bits zero, and 0 in pointer context would be a 4-byte null pointer,
> probably with all bits zero.
The compiler I used at least tried to be C89. (Borland Turbo C++ 1.01)
> C doesn't require that the address represented by the null pointer (whether
> or not it is all-bits-zero) is inaccessible, merely that there is no C
> object or function there. A simple shim of the appropriate size (1, 2, 4,
> 8 bytes depending on the CPU's alignment rules) will suffice.
Which was nice with the tiny model: a .COM file organized at near 0x0100,
and iirc, there was guaranteed to be 0xCD 0x20 at 0x0000. (The 8086 "INT
20H" instruction. I just checked in DOSEMU with PC DOS 7, and that is
exactly what shows up there.)
"ANSI C" doesn't mean a lot though when 95% of the code I run across uses
extensions. I still have not successfully kitbashed the Bourne shell onto
native DOS, OS/2 or Windows without an emulation layer - in any form. Did
come *pretty* close with the Forsyth shell but I couldn't work around the
lack of fork() (OS/2 does have a near-exact counterpart for pipe(), but
it's not exposed by the pipe() call for some reason.) I like my Unix
shells even on Microsoft OSes...call me crazy. ;)
-uso.
next prev parent reply other threads:[~2020-09-21 21:40 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 23:00 Norman Wilson
2020-09-20 23:53 ` Clem Cole
2020-09-21 0:00 ` Clem Cole
2020-09-21 2:24 ` John Cowan
2020-09-21 0:09 ` Warner Losh
2020-09-21 1:05 ` Clem Cole
2020-09-21 5:55 ` Steve Nickolas
2020-09-21 5:59 ` Warner Losh
2020-09-21 18:40 ` Paul Winalski
2020-09-21 19:56 ` Dan Cross
2020-09-21 20:50 ` John Cowan
2020-09-21 21:22 ` Rob Pike
2020-09-21 21:57 ` Clem Cole
2020-09-21 23:56 ` John Cowan
2020-09-22 0:54 ` Richard Salz
2020-09-21 21:39 ` Steve Nickolas [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-09-25 14:19 Doug McIlroy
2020-09-28 17:35 ` Angelo Papenhoff
2020-09-20 22:51 Norman Wilson
2020-09-19 1:51 Doug McIlroy
2020-09-20 18:42 ` arnold
2020-09-20 19:28 ` Will Senn
2020-09-20 20:12 ` Steve Nickolas
2020-09-20 20:26 ` Doug McIlroy
2020-09-20 20:57 ` Doug McIlroy
2020-09-20 22:13 ` Clem Cole
2020-09-21 20:43 ` Steffen Nurpmeso
2020-09-20 20:58 ` Steve Nickolas
2020-09-20 21:33 ` Brantley Coile
2020-10-07 5:43 ` scj
2020-09-20 21:35 ` John Cowan
2021-02-02 23:08 ` Greg A. Woods
2021-02-02 23:47 ` Larry McVoy
2021-02-03 0:11 ` Dave Horsfall
2021-02-03 0:19 ` Larry McVoy
2021-02-03 2:04 ` Richard Salz
2021-02-03 3:32 ` Dave Horsfall
2021-02-03 4:32 ` M Douglas McIlroy
2021-02-03 11:27 ` Peter Jeremy via TUHS
2021-02-03 20:09 ` Dave Horsfall
2021-02-03 20:13 ` Niklas Karlsson
2021-02-03 23:46 ` Tom Lyon
2021-02-03 22:19 ` Dave Horsfall
2021-02-03 22:55 ` M Douglas McIlroy
2020-09-20 22:15 ` Clem Cole
2020-09-20 22:47 ` John Cowan
2020-09-21 20:48 ` Steffen Nurpmeso
2020-09-21 20:46 ` Steffen Nurpmeso
2020-09-24 2:25 ` Dave Horsfall
2020-09-24 2:33 ` Clem Cole
2020-09-27 5:54 ` Dave Horsfall
2020-09-24 17:19 ` Paul Winalski
2020-09-24 18:17 ` John Cowan
2020-10-07 5:47 ` scj
2020-10-07 9:20 ` arnold
2020-10-08 0:27 ` Dave Horsfall
2020-10-08 3:08 ` John Cowan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.21.2009211732330.13076@sd-119843.dedibox.fr \
--to=usotsuki@buric.co \
--cc=cowan@ccil.org \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).