Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!m2c!applix!scott From: scott@applix.UUCP (Scott Evernden) Newsgroups: comp.sys.amiga Subject: Re: Lattice Bug??? Message-ID: <652@applix.UUCP> Date: 15 Feb 88 02:18:23 GMT References: <8802141749.AA02432@jade.berkeley.edu> Reply-To: scott@applix.UUCP (Scott Evernden) Organization: APPLiX Inc., Westboro MA Lines: 23 In article <8802141749.AA02432@jade.berkeley.edu> CRONEJP@UREGINA1.BITNET (Jonathan Crone) writes: >/* Builtin_Bug.c by Wayne Hogue, Regina, Sask. Canada */ >.. > If an integer is set to the length of a string and then nothing else > is done with the integer, a crash will occur if the integer is used in > an IF statement. ... >#include "string.h" >char MyString[] = { "This is a test string." }; > i = strlen(&MyString[0]); > if ( i > 0 ) > printf("A crash will occur when doing this IF statement.\n"); This bug was discussed here several weeks ago. Basically, Lattice's builtin/in-line strlen() yields its result in an Ax register. Certain subsequent relational tests will cause a TST.L Ax instruction to be generated- unfortunate, since this is an Illegal Instruction. Best advise is to avoid using , or if you must, "#undef strlen" afterwards. -scott