is a void function invocation an expression or a statement?

Wayne Throop throopw at dg_rtp.UUCP
Fri Aug 15 08:51:55 AEST 1986


> jack at mcvax.uucp (Jack Jansen)
> Something that has been bothering me since I read the C standard (well,
> read.... paged through it), and came up again after this discussion
> is the following: why haven't the C standardisers treated void like
> in algol-68? There, void is a fullfledged type, having only one
> value, also called void.

I'm not so sure they didn't, in effect and intent, if not in so many
words.  The real differences from what you describe seem to be only two.
C's void type has no legal values at all, rather than just one.  And no
objects may be of type void (though expressions can be).

> Are there any good reasons for not making void a normal type?

Well, in putting it the way they do, X3J11 avoid the problem of what
happens if you try to take the address of a void object.  Even in Algol,
this is probably anomalous, since a void object (only one legal value)
can be stored in zero bits, so where you allocate it is sort of, well,
arbitrary, isn't it?

--
The importance of information is directly proportional
to its improbability.
-- 
Wayne Throop      <the-known-world>!mcnc!rti-sel!dg_rtp!throopw



More information about the Comp.lang.c mailing list