Problem with fflush command

D

doc.bullwinkle

I've installed Eclipse with minGW on windowsxp....
I try to run the helloword program

#include <stdio.h>
#include <stdlib.h>

int main(void) {
printf("!!!Hello World!!!"); /* prints !!!Hello World!!! */
fflush(stdout);
return 0;
}

but when i go in debug mode and use step-into function, after the
command fflust(stdout) i have this error on consolle

!!!Hello World!!!280*stopped,reason="end-stepping-range",thread-
id="1",

can you help me?
Thanks
 
I

Ike Naar

I've installed Eclipse with minGW on windowsxp....
I try to run the helloword program

#include <stdio.h>
#include <stdlib.h>

Small nit: you don't need said:
int main(void) {
printf("!!!Hello World!!!"); /* prints !!!Hello World!!! */
fflush(stdout);
return 0;
}

but when i go in debug mode and use step-into function, after the
command fflust(stdout) i have this error on consolle

!!!Hello World!!!280*stopped,reason="end-stepping-range",thread-
id="1",

What is the problem? The message looks like an informational message
that tells you that you have reached the end of the program.
Why do you think it's an "error" ?.
 
B

Beej Jorgensen

!!!Hello World!!!280*stopped,reason="end-stepping-range",thread-
id="1",

This isn't really an error, from what I know. gdb (with
-interpreter=mi, made for interacting with other programs and IDEs like
Eclipse) outputs this after every statement executed when
single-stepping. It merely means, "I've stopped execution because I'm
at the end of the line you told me to step over." But it is weird to
actually see it in the output, since you'd expect Eclipse to catch the
gdb output and deal with it.

I'm guessing that Eclipse is getting confused because you didn't have a
newline after "!!!Hello World!!!", which is something you really should
have anyway (unless you had a reason for not.)

Disclaimer: I'm not running Windows or Eclipse, so I might be barking up
the wrong tree entirely.

-Beej
 
F

Flash Gordon

(e-mail address removed) wrote:

fflush(stdout);
return 0;
}

but when i go in debug mode and use step-into function, after the
command fflust(stdout) i have this error on consolle

!!!Hello World!!!280*stopped,reason="end-stepping-range",thread-
id="1",

Probably because it has reached the end of the program (try
disassembling it before stepping through). If you need more help I
suggest the mailing list for the debugger you have told Eclipse to use,
or the appropriate MinGW mailing list since you are using MinGW. The
details of how the debugger works are not really related to C itself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top