Article View: net.micro.atari16
Article #2276bug in megamax C
From: D'arc Angel
Date: Fri, 10 Oct 1986 16:59
Date: Fri, 10 Oct 1986 16:59
41 lines
1227 bytes
1227 bytes
~~~~~~~~~~~~~~~\ lineater, \~~~~~~~~~~~~~~~~~~~~~
here's a cute bug in megamax C:
int c;
while((c = getchar()) != EOF) {
.
.
.
}
works fine but:
unsigned char c;
while((c = getchar()) != EOF) {
.
.
.
}
loops infinately, the problem is that megamax generates the
following code:
AND #0xff,D0 ;D0 has the result of getchar
CMP #-1,D0 ;ooppsss should be CMP.B
ah well
--
----
These are days for the locust to eat
- Winston Churchill
Name: James M. Turner
Mail: Imagen Corp. 2650 San Tomas Expressway, P.O. Box 58101
Santa Clara, CA 95052-8101
AT&T: (408) 986-9400
UUCP: ...{decvax,ucbvax}!decwrl!imagen!turner
CompuServe: 76327,1575
GEnie : D-ARCANGEL
Technical Details
Message-ID:
<609@imagen.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!elbereth!rutgers!sri-spam!sri-unix!hplabs!pyramid!decwrl!sun!imagen!turnerShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!elbereth!rutgers!sri-spam!sri-unix!hplabs!pyramid!decwrl!sun!imagen!turner From: turner@imagen.UUCP (D'arc Angel) Newsgroups: net.micro.atari16 Subject: bug in megamax C Message-ID: <609@imagen.UUCP> Date: Fri, 10-Oct-86 12:59:39 EDT Article-I.D.: imagen.609 Posted: Fri Oct 10 12:59:39 1986 Date-Received: Sun, 12-Oct-86 13:40:36 EDT Distribution: net Organization: The Houses of the Holy Lines: 41