Path: utzoo!utgpu!attcan!uunet!husc6!uwvax!oddjob!gargoyle!att!mtuxo!mtgzz!drutx!druhi!lbl
From: lbl@druhi.ATT.COM (Barry Locklear)
Newsgroups: comp.sys.atari.st
Subject: Re: Laser C bug
Summary: a suggestion
Message-ID: <3393@druhi.ATT.COM>
Date: 18 Aug 88 13:40:07 GMT
References: <365@polyof.UUCP>
Organization: AT&T, Denver, CO
Lines: 24

In article <365@polyof.UUCP>, jeff@polyof.UUCP (A1 jeff giordano ) writes:
-> 
-> Actually I wouldn't call it a bug, but more a deficience in the
-> grammar.  The following drove me nuts:
-> 
-> 		for(x=-1; x<=1; x++) { ... }
-> I wanted to loop from -1 to 1.  However, the above is ambigous, it is an
-> old style declaration.  I did not find out until I tried my prog on our
-> UNIX system.  The UNIX cc gives:
-> 	Warning: oldstyle declaration on line xx.
-> 
-> Laser gives no such warning and actually takes whatever the previous
-> value was and drecrements it by one.  then does the loop.  not what i thought it
-> would do.

Jeff,

 You probably figured this out already, but I'll send this out anyway.
 Instead of using "x=-1" try "x = -1".  This should parse correctly.
 C originally allowed -= and =- to mean the same thing.  Apparently
 Laser C still let's you do this. That's why I *always* put spaces
 around my operators!

Barry