home *** CD-ROM | disk | FTP | other *** search
- Path: etek.chalmers.se!chalmers.se!sunic!mcsun!uunet!zaphod.mps.ohio-state.edu!wupost!sdd.hp.com!col.hp.com!fc.hp.com!koren
- From: koren@fc.hp.com (Steve Koren)
- Newsgroups: comp.sys.amiga.programmer
- Subject: SAS6.1 users: please read
- Message-ID: <ByM64K.6z2@fc.hp.com>
- Date: 2 Dec 92 04:07:32 GMT
- Sender: news@fc.hp.com (news daemon)
- Organization: Hewlett-Packard Fort Collins Site
- Lines: 45
- X-Newsreader: Tin 1.1.3 PL5
-
- I am posting this note to let SAS 6.1 users know of a serious
- problem I have found which can cause insiduous problems with
- your code. I have sent this to EMITS and am just pointing
- it out here in hopes someone else can avoid what I ran in to.
- I thought twice about posting it here because I do not want
- to reflect badly on SASC, which is wonderful in general. But
- I decided that the magnitude of the problem warrents a warning
- to other users. I'm sure they'll fix it right pronto. SAS has
- been very responsive to fixing things reported via EMITS, and
- collectively deserve our appriciation for that I think.
-
- Consider this code:
-
- /***********************************************************************
- ** sc test1.c
- ** slink from lib:c.o test1.o to test1 lib lib:sc.lib
- ***********************************************************************/
-
- # include <stdio.h>
- # include <string.h>
-
- main(int argc, char **argv) {
- char *str = "abc";
- int num = 7;
-
- if ((strlen(str) - num) > 0) {
- printf("Ooops!\n");
- }
-
- exit(0);
- }
-
- Even though one would expect
- if ((strlen(str) - num) > 0) {
-
- in cases where strlen(str)=3 and num=7 to fail (ie, 3-7 is -4,
- and -4 is NOT greater than 0 last time I checked), the if
- statement passes instead.
-
- I hope this helps someone else avoid the code problems I was
- having. I'm sure they'll fix this for 6.2. SASC continues,
- IMHO, to be the best development environment for the Amiga bar
- none.
-
- - steve
-