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: gcc


Stuart Longland <stuartl at longlandclan dot hopto dot 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


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