Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!rutgers!topaz.rutgers.edu!ron
From: ron@topaz.rutgers.edu (Ron Natalie)
Newsgroups: comp.lang.c
Subject: Re: Was that a Sun bug?
Message-ID: <13321@topaz.rutgers.edu>
Date: Tue, 14-Jul-87 15:00:17 EDT
Article-I.D.: topaz.13321
Posted: Tue Jul 14 15:00:17 1987
Date-Received: Fri, 17-Jul-87 01:13:53 EDT
References: <1429@cci632.UUCP>
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 22
Keywords: bug comparison Sun Parallel

It does not happen on my Sun (3.2).

Point out the following lines in K&R to your rep:

From Appendix A, C Reference Manual

p. 190, sec 7.7 Equality Operators
    The == (equal to) and the != (not equal to) operators are
    exactly equal to the relational operators except for their
    lower precedence.

p. 189, sec 7.6 Relational Operators
    The usual arithmetic converstions are performed.

p. 184. sec 6.6 Arithmetic Conversions
    This pattern will be called the "usual arithmetic conversions"

    First, any operands of type char or short are converted to int.

Hence, both sides should be type int before the comparison is performed.

-Ron