From: SOLYOM Andras Message-Id: <199802012210.XAA01335@goliat.eik.bme.hu> Subject: Compiler error! (and something about Virtual memory) To: djgpp AT delorie DOT com Date: Sun, 1 Feb 1998 23:10:41 +0100 (MET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk First the latter: I have sent a question regarding virtual memory when one of my program crashed. I tried everything I was proposed. Then when nothing have worked I have rewritten the code to first determine the total size I needed then to allocate memory in 4096 bytes blocks till that amount in a second run. The program is much slower, but works. In this same program I have discovered a compiler error with -O3. I have this little code in my program .... fseek(fCC, sizeof(TFILEHEADER) + newNewsRecord.lKeywords[i]*sizeof(TKEYRECORD), 0); fread(&kr, sizeof(TKEYRECORD), 1, fCC); while(kr.lParent) { /* get ordinal of record in ll */ ll = (kr.lParent - sizeof(TFILEHEADER)) / sizeof(TKEYRECORD) + 1; if(ll >= lMin && ll < lMax) SetBit(ll-lMin, l); fseek(fCC, kr.lParent, 0); fread(&kr, sizeof(TKEYRECORD), 1, fCC); } .... When compiled with -O3 the first fread() has never been executed: it was missing from the code! Without -O3 it worked fine. I am using gcc 2.7.2.1. So you have been warned... Andras