LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-03-2005, 05:41 AM   #1
dogbird
Member
 
Registered: Nov 2004
Location: oklahoma
Distribution: slackware 9.0
Posts: 98

Rep: Reputation: 15
A GCC code generation problem?


i have found what looks like a code generation problem.


There are 15 text lines between start of text and "START"


I have a loop
While ( index("START",data[where] ) {
grmr[gindx] = data[where];
printf(" %s \n".data[where]'
gindx++'
where++;
};

The loop only read 2 lines then exits. It should not. it should do 15 lines;

someone please tell me how to fix this
 
Old 12-09-2005, 07:23 AM   #2
nbd
Member
 
Registered: Aug 2002
Posts: 41

Rep: Reputation: 15
What it is that you are actually trying to do?

Please give an example of the text file you are parsing, and what do you want the parser to do.
 
Old 12-09-2005, 08:37 AM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
It would help to see more of the code... it is likely your just overlooking something small. There are certainly bugs in GCC.. but I am skeptical that you have found one here.

Also, please use the code blocks when you type code.

This:
Code:
int main ()
{
    int i;
    ...
}
Looks much better then this:
int main()
{
int i;
...
}
 
Old 12-09-2005, 08:50 AM   #4
Dana
LQ Newbie
 
Registered: Jun 2005
Posts: 8

Rep: Reputation: 0
Well, first of all, unless the paste went wrong, that code won't even compile because the printf line has a period instead of a comma, is missing a close ) and a semi-colon. Also, gindx++ has a ' instead of a semi-colon.

I hate to ask, but are you positive that you are compiling and executing the correct file?
 
Old 12-09-2005, 11:52 AM   #5
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Im astounded it even compiled im sure he dident paste but rewrote really fast. I do such things from time to time.
 
  


Reply



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
tool for code generation? bcalmac Linux - Software 0 08-22-2005 10:41 AM
Code generation based on latex math ahwkong Programming 0 04-17-2005 06:28 AM
Problem in executing code in gcc gcc_learner Programming 3 03-26-2005 03:28 AM
Problem compiling code in g++ works for gcc juan_de_margo Programming 3 02-24-2005 03:41 AM
UML and C++ code generation GŠutama Linux - Software 2 11-13-2003 06:56 AM

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

All times are GMT -5. The time now is 12:46 AM.

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
Open Source Consulting | Domain Registration