🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6044

Re: C's triadic operator.

#6044
From: Jim Gardner
Date: Wed, 17 May 1989 08:21
23 lines
1540 bytes
In article <26212@watmath.waterloo.edu> rbutterworth@watmath.waterloo.edu (Ray Butterworth) writes:
>Unfortunately that last rule is not the one in the Standard.
>What it has is:
>- If one expression is a pointer to (possibly qualified) void
>  and the other is any arbitrary type, the arbitrary pointer
>  is coerced to be an unqualified pointer to void.

There is a better way to read the standard:

	(from section 3.3.15)
	"If both the second and third operands are pointers [...]
	 the result type is a pointer to a type qualified with all the type
	 qualifiers of the types pointed to by both operands. Furthermore,
	 [...]; otherwise, one operand is a pointer to void or a qualified
	 version of void, in which case the other operand is converted to
	 type pointer to void, and the result has that type."

The last part is misleading.  The otherwise clause is in a sentence that
begins with "furthermore", so the union of qualifications specified in
the first sentence also has effect in the second.  The result type is not
"pointer to void", but "pointer to void with all the type qualifiers...".

David Tanguay != Jim
Technical Details
Message-ID: <26273@watmath.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!jagardner
References: <26212@watmath.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!jagardner
From: jagardner@watmath.waterloo.edu (Jim Gardner)
Newsgroups: comp.std.c
Subject: Re: C's triadic operator.
Message-ID: <26273@watmath.waterloo.edu>
Date: 17 May 89 08:21:43 GMT
References: <26212@watmath.waterloo.edu>
Reply-To: jagardner@watmath.waterloo.edu (Jim Gardner)
Distribution: comp
Organization: U. of Waterloo, Ontario
Lines: 23