Path: 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 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