Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!cornell!rochester!ur-tut!sunybcs!boulder!hao!noao!mcdsun!fishpond!fnf From: fnf@fishpond.UUCP (Fred Fish) Newsgroups: comp.sys.amiga Subject: Re: printf() Message-ID: <13@fishpond.UUCP> Date: 4 Mar 88 01:31:10 GMT References: <7364@cisunx.UUCP> Reply-To: fnf@fishpond.UUCP (Fred Fish) Organization: occasionally Lines: 28 In article <7364@cisunx.UUCP> ejkst@cisunx.UUCP (Eric J. Kennedy) writes: >I was trying to track down a bug that was causing an immediate 'task >held' requester. The problem appeared to be comming at the very >beginning of the program, so I inserted a printf("Beginning\n"); as the >first line of the program, after the declarations. I still got a 'task >held' requester _before_ anything printed out. > >Now, my question is, why the heck didn't my message print out if it was >before the actual bug? Is this a side effect of multitasking? Is it Most likely you would have gotten your message if you had flushed your stdio output buffers via an "fflush" call. A delay after the fflush might also be necessary. Both of these facilities are provided automatically by my macro based debugging package (dbug) distributed on several disks in my library. I believe the latest version is on disk 102. You can even specify the delay interval after each debug output line, in 0.10 second increments. And best of all, you don't have to remove the debugging support to disable it or clean up your code. Thus when the next bug crops up, you'll be "armed and ready". -Fred ><> -- # Fred Fish hao!noao!mcdsun!fishpond!fnf (602) 921-1113 # Ye Olde Fishpond, 1346 West 10th Place, Tempe, AZ 85281 USA