Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!ukma!dftsrv!oneel From: oneel@heawk1.gsfc.nasa.gov ( Bruce Oneel ) Newsgroups: comp.os.msdos.programmer Subject: Re: HELP!!! - code executes different on same data Message-ID: Date: 23 May 91 14:24:00 GMT References: <1991May23.131907.11319@unlinfo.unl.edu> Sender: news@dftsrv.gsfc.nasa.gov Organization: STX/GSFC Nasa Lines: 35 In-reply-to: khawand@hoss.unl.edu's message of 23 May 91 13:19:07 GMT In article <1991May23.131907.11319@unlinfo.unl.edu> khawand@hoss.unl.edu (Nancy Khawand) writes: I am using MSC to write a macro interface to Harvard Graphics - no big deal. The problem however is that when I execute my code I get different results from the same data each time it is run. Sometimes the program works as I expect and sometimes it crashes the machine. Removing printf debug statments also seems to affect the outcome. I talked with MS and they said to recompile the program disabling all optimizations. When I do that, the programs doesn't work at all. Does anyone have any suggestions as to what to look for - I'm one lost sole on this one. Ahh, the joys of C. Are you using 6.0? If so, are you using function prototypes? It's worth the time to put them in. You may have botched calling a function. The other worth guess is that you've botched a pointer and something is getting overwritten. When adding/removing statements which shouldn't affect the code (such as printf) have effects then that may be the problem. If it fits, can you try the small model? That might at least stop over-writing the code portion of your program. You can also try the (medium,compact) model, which ever gives you 64k data, but 1 meg code. Good luck. bruce. p.s. Sometimes, Fred Brook's advice is a good idea. You learned quite a bit from the first try. Start over fresh. It'll probably work better. -- Bruce O'Neel oneel@heasfs.gsfc.nasa.gov NASA/GSFC/STX/Code 664