[TUHS] reviving a bit of WWB
Greg A. Woods
woods at robohack.ca
Wed Feb 3 09:08:42 AEST 2021
At Sun, 20 Sep 2020 17:35:52 -0400, John Cowan <cowan at ccil.org> wrote:
Subject: Re: [TUHS] reviving a bit of WWB
>
> When 0 is coerced implicitly or explicitly to a pointer type, it becomes a
> null pointer. That's true even on architectures where all-bits-zero is
> *not* a null pointer. However, in contexts where there is no expected
> type, as in a call to execl(), the null at the end of the args list has to
> be explicitly cast to (char *)0 or some other null pointer.
Yeah, that's more to do with the good/bad choice in C to do or not do
integer promotion in various situations, and to default parameter types
to 'int' unless they are, or are cast to, a wider type (and of course
with the rather tricky and almost non-portable way C allows variable
length argument lists, along with the somewhat poor way C was cajoled
into offering function prototypes to support separate compilation of
code units and the exceedingly poor way prototypes deal with variable
length argument lists).
--
Greg A. Woods <gwoods at acm.org>
Kelowna, BC +1 250 762-7675 RoboHack <woods at robohack.ca>
Planix, Inc. <woods at planix.com> Avoncote Farms <woods at avoncote.ca>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP Digital Signature
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20210202/40a184f0/attachment.sig>
More information about the TUHS
mailing list