LinuxQuestions.org
Weather apps tell you it'll rain. Wyndo tells you when to go.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-19-2005, 01:02 AM   #1
dogbird
Member
 
Registered: Nov 2004
Location: oklahoma
Distribution: slackware 9.0
Posts: 98

Rep: Reputation: 15
Unhappy GCC 2.2.2 seems to genrate bad code


I have written some bad code that I am debugging. I have a loop with several statements in it. It does not step through the code in the loop. It executes the first statement. It does not execute anything after that. There is nothing wrong with the code. GDB just will not step through the loop at all.

It looks like bad code being generated. sigh. This is a standalone machine and moving things to it is very difficult. Only the floppy can be used.

Please Tell me some work around for this.

The code is generally as follows


symbol_table ( Cchar *) inname, int id)
{
token2 = (char *) malloc(64*sizeof(char));

if ( last_name != 0 ) {

(1) for (i=1;i<=last_name;i++){


(2) token2 = symbol_name[i];

i/* the last statement is in a loop with the for loop. No other statements execute.

if (strcmp(inname, token2) == 0)

more statements and they are compileable clean.



josephus
 
Old 11-19-2005, 04:59 AM   #2
creolophus
Member
 
Registered: Nov 2005
Posts: 34

Rep: Reputation: 15
umm .... isnt everyone else using GCC 3.2/3.3/4.0 ?

*somehow* try to get one of the later releases
 
Old 11-19-2005, 12:55 PM   #3
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
to rule out your code being the problem, have you tried to use the code with a later verion of gcc on another machine?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora Core 4 bad gcc? sausagejohnson Fedora 7 07-05-2005 09:12 AM
shell prints bad code when returning message backpacker Linux - Software 14 06-29-2005 02:53 AM
Code: Bad EIP Value <0>Kernal panic oprogue DamnSmallLinux 5 01-28-2005 08:27 AM
Bad switch statement (problem in the code block?) nifflerX Linux - General 2 07-14-2004 03:45 PM
bad GCC astitva Linux - Software 1 12-27-2003 11:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:01 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions