X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Date: Mon, 24 Sep 2007 00:21:08 -0400 From: Ethan Rosenberg Subject: Re: C programming errors, and some other things In-reply-to: To: djgpp AT delorie DOT com Message-id: <0JOU00MQKURN0MH0@mta5.srv.hcvlny.cv.net> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: <0JOK00CBNJLO0VL0 AT mta3 DOT srv DOT hcvlny DOT cv DOT net> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk At 11:46 PM 9/21/2007, you wrote: >On Tue, 18 Sep 2007 10:43:55 -0400 in comp.os.msdos.djgpp, Ethan >Rosenberg wrote: > > >Dear List - > > > >Can someone please help me with the following C code. It aborts with > >code 1. My apologies for the length of the code. > > > >Ethan > > > >============= > > >} > > > > fspacing = (float)spacing; > > fgain = fspacing/3.0 + 2.0; > > > > gain = (int)fgain; > > if(fgain - gain > 0.5) > > gain = gain +1; > > > > return gain; > > > >} > >====== > >It doesn't even compile with the above junk at the end. >Run gcc -Wall -Wextra and fix all complaints first! > >-- >Thanks. Take care, Brian Inglis Calgary, Alberta, Canada > >Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca) > fake address use address above to reply To ALL of the list - Thank you ever so much for all of your wonderful help. Brian - I am a newbie, and can make stupid mistakes. 1] My apologies for the above. I had removed some proprietary code from the program, and that caused it to hang when you tried to compile. That issue I fixed ... two misplaced braces. 2] Problem with display solved by using another computer w/o a video card designed to run two monitors. 3] However... previously when I compiled with RHIDE, the screen would show the compile commands; eg, gcc bla.c -g bla.o [I am probably not accurate with what I just wrote, but you have the idea.] Now all it says it "compiling". 3] If I set a breakpoint, and wish to run till breakpoint [F4], RHIDE crashes with a diagonal display on the screen showing some of the C code, and some messages "code not created for ....". I think it is being compiled w/o debugging code and is being optimized. Is there any compiler flag that will force the system not to optimize? 4] If I step thru the program, [F7 or Shift F7], the user screen is never displayed. When the program needs input, there is no way to do it. FYI - I was using ver 5 of RHIDE [rhid15ab.zip] and was experiencing the above problems. I switched to an earlier version, [rh1501b.zip] and the problem persists. Again, much thanks. Ethan