C's triadic operator.

Norman Diamond diamond at diamond.csl.sony.junet
Tue May 16 15:08:54 AEST 1989


In article <26212 at watmath.waterloo.edu> rbutterworth at watmath.waterloo.edu (Ray Butterworth) writes:

>With diadic operators they are fairly obvious and reasonable:
...
>- If one operand is a pointer to void, and the other is a pointer
>  to some other type, the void pointer will be coerced to the
>  same type as the other pointer.

>With triadic operators (i.e. c?e1:e2) we have:
...
>- 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.

>Does that seem obvious, reasonable, or useful to anyone out there?

Not to me, though this doesn't answer your question.

>Since the Rationale has nothing to say about this,
>can someone on the Comittee tell us why such strange behaviour
>with "?:" is required?

Surely you've seen the sign, once posted at Waterloo's computer centre:

    "Consistency is the last refuge of an uncreative person."

?:-)

--
Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.co.jp at relay.cs.net)
  The above opinions are my own.   |  Why are programmers criticized for
  If they're also your opinions,   |  re-implementing the wheel, when car
  you're infringing my copyright.  |  manufacturers are praised for it?



More information about the Comp.std.c mailing list