gcc

Matthieu Moy Matthieu.Moy@imag.fr
Mon Mar 31 13:28:00 GMT 2003


Stuart Longland <stuartl@longlandclan.hopto.org> writes:

> Not sure about it not appearing at all.  I think it would appear when
> the program ends, but then again, I may be wrong.

If the program ends properly, I  think the output *has* to be flushed,
(At least,  it does in  most cases) but  for example, if  your program
makes a segfault,  you will probably loose the  contents of the output
buffer. 

in

printf("Hello\n");
f();
printf("world");
g();

if the output  is just "Hello", and segmentation  fault, the crash may
have occured in f() or g() ... 

That's why its generally  a good advice to put "\n" at  the end of any
debug/test output. 

-- 
Matthieu



More information about the Gcc-help mailing list