🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9316

Re: Bug in 4.3 C

#9316
From: Joseph S. D. Yao
Date: Tue, 16 Sep 1986 13:23
21 lines
1374 bytes
In article <809@navajo.STANFORD.EDU> rokicki@navajo.STANFORD.EDU (Tomas Rokicki) writes:
>/*   This program should print out: -1 0
> *   however, under 4.3 bsd, it prints out -1 1 */
>main () {
>  register unsigned char a=1, b=2 ;
>  printf("%d %d\n", ((int)(a))-((int)(b)), ((int)(a))-(int)(b))) > 1 ) ;
>}

Your parenthesisation is bad:  in this form, no compiler could
accept it.

printf("%d %d\n", ((int)(a))-((int)(b)), ((int)(a))-(int)(b))) > 1 );
      1		  23   33 32 23   33 32  23   33 32 2   22 210     -1

I'm not suggesting that this is your entire problem; but why don't
you turn on the sm [showmatch] option of vi [which I normally hate],
re-write this line, and try it again?  Then post the results.
-- 

	Joe Yao		hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}
			jsdy@hadron.COM (not yet domainised)
Technical Details
Message-ID: <563@hadron.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!sundc!hadron!jsdy
References: <809@navajo.STANFORD.EDU>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!sundc!hadron!jsdy
From: jsdy@hadron.UUCP (Joseph S. D. Yao)
Newsgroups: net.lang.c
Subject: Re: Bug in 4.3 C
Message-ID: <563@hadron.UUCP>
Date: Tue, 16-Sep-86 09:23:32 EDT
Article-I.D.: hadron.563
Posted: Tue Sep 16 09:23:32 1986
Date-Received: Tue, 16-Sep-86 22:02:05 EDT
References: <809@navajo.STANFORD.EDU>
Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao)
Organization: Hadron, Inc., Fairfax, VA
Lines: 21
Summary: Watch your parenthesisation.