This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C Execution Problem


Ponchi wrote:
Hi all,

gcc has succesfully compiled my C code without any warning and error, but
when I tried to run the program even if I waited for a long time it still
did not give any output, seems like running and running all the time. I
checked the code and there is no possibility to have an infinite loop.

On the other hand, I tried to find the problem by putting printf above all
my function, and I think the problem is about reading .txt files. I checked
the code thousands times but it is fine.

Do you have any idea why the compilation is successful but I am still having
trouble with running? May it be something about gcc, or is it just about my
code?

Debug your code?


Why not compile with debug syms turned on then use gdb to find out where it's hung by issuing a SIGINT (e.g. ^C) and see what pops out?

You can also run it through strace and see if you're blocked on a syscall.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]