From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6803 invoked from network); 21 Sep 2020 20:50:48 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 21 Sep 2020 20:50:48 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 8F8369CC15; Tue, 22 Sep 2020 06:50:47 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 3AAC293D33; Tue, 22 Sep 2020 06:50:31 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ccil-org.20150623.gappssmtp.com header.i=@ccil-org.20150623.gappssmtp.com header.b="Oubd7qXf"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 27FDE93D33; Tue, 22 Sep 2020 06:50:28 +1000 (AEST) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by minnie.tuhs.org (Postfix) with ESMTPS id EF96593D06 for ; Tue, 22 Sep 2020 06:50:26 +1000 (AEST) Received: by mail-qv1-f51.google.com with SMTP id db4so8270293qvb.4 for ; Mon, 21 Sep 2020 13:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iH4cmZzggUGSv4CulYyugg3TgdETUFzIZj42a4FmGUU=; b=Oubd7qXfWXOf9bR8igWpdnQwT/TbgAH7LO+NnOxpdMFCbWA2M4AKbNHfbfpAfcO23P TnrNe1Gzc+xivB40aqWD1hrtHTC50f8RSZDjwKFSSkN1pheppo2DD3wGnvaZtJXyaYT2 roReWkcG/KX+pScExdMJ/3Ou3lavT6wxfXqRkYiozZzoCQLtWNvlQTq7ka8KuTadqPP5 KcNtIpjbfsgeIUeeZD9gZ8TO9EsNnw3R3kYE82fIxLedwq8Hh/5OZJ+ig7Qnr8OHhT0J /4s/P1ti51wcq2qdvNRc1kkCmSikgFz0P/BqYVNzSvoXneZzk8YReyJsU1MjvqzyBTbc Tpgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iH4cmZzggUGSv4CulYyugg3TgdETUFzIZj42a4FmGUU=; b=FWArfjhIt6x/cQ6dJJ36zfnFmStP1AM3HG87Yvnxz8F4F4i5DCc6UfYb6r99EgPMPA W/9lnodS4FSW5fs6wl2TpKRKPr5QHjT3tOUjXithEacfTRedeO/YxPupE1g7oc2FSlDY 23vG1diYp1IcDSFUHzNATgjrWEMHGHOeXi+SJ17PrF2z4oKrrIZFBYpPPOep+WrMS5Sh Wf94N6jfjhLhDeAgC2hAIYdzOl+vcvO8RaWlqB2rY36yrfjEaeNcbYkqivd21SSPXcJ0 g6n7gVSOvl5rSg20b0+31oLjZg8ZNCFomrhCTjARDYrLJUMxF6Mqdgf6UNVfXdELxrCi sMAA== X-Gm-Message-State: AOAM531WdGzQ680cEZg8fg+EJkarpfeaIeuGr8F78c3/sPFtwRBIM8cB tdP7miCFEAhZSz7/xgP/lUiJQy4rtjVgNXwg23LFww== X-Google-Smtp-Source: ABdhPJxErxDNTseoMtjm2KNbK+zxBd48UJjZnI2RYrMBXMu4Y8oTJqnDBuoPEBI/8h0sFo/kM+imMAfdPR67x0xo+3I= X-Received: by 2002:a05:6214:1784:: with SMTP id ct4mr2147120qvb.10.1600721425991; Mon, 21 Sep 2020 13:50:25 -0700 (PDT) MIME-Version: 1.0 References: <20200920230057.C5D1A4422E@lignose.oclsc.org> In-Reply-To: From: John Cowan Date: Mon, 21 Sep 2020 16:50:14 -0400 Message-ID: To: Steve Nickolas Content-Type: multipart/alternative; boundary="000000000000fb1faa05afd8ffda" Subject: Re: [TUHS] reviving a bit of WWB X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000fb1faa05afd8ffda Content-Type: text/plain; charset="UTF-8" On Mon, Sep 21, 2020 at 1:55 AM Steve Nickolas 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. 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. --000000000000fb1faa05afd8ffda Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Sep 21, 2020 at 1:55 AM Steve= Nickolas <usotsuki@buric.co>= ; wrote:
=C2=A0
I've never written anything that uses varargs, so I've n= ever run into
that.=C2=A0 But I've actually done quite a bit of work with an environm= ent
where this isn't true: MS-DOS using the large or huge model.=C2=A0 In t= his
environment, sizeof(int)=3D2, and sizeof(void*) is 4. Of course, it's n= ot conformant to pass an int variable as an argument where a pointer variab= le is expected.

If the compiler was ISO= -conformant (which it almost certainly was not), that would not matter.=C2= =A0 0 in int context would be a 2-byte int with all bits zero, and 0 in poi= nter context would be a 4-byte null pointer, probably with all bits zero.

C doesn't require that the address represented = by the null pointer (whether or not it is all-bits-zero) is inaccessible, m= erely that there is no C object or function there.=C2=A0 A simple shim of t= he appropriate size (1, 2, 4, 8 bytes depending on the CPU's alignment = rules) will suffice.

--000000000000fb1faa05afd8ffda--