This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: cplus-dem.c tiny patch


> Date: Fri, 7 Jul 2000 09:52:02 -0400
> From: DJ Delorie <dj@delorie.com>
> 
> Wouldn't it be better to just call setvbuf() in main, forcing the
> output to be line buffered instead of block buffered?  

Perhaps.  I have no preference as long as the program can be used in a
ping-pong manner, passing symbols in and getting them back demangled.
It's more useful as a component if it can do this.

> It would more obviously show your intentions, rather than a naked
> fflush in the middle of a loop with no comments saying why it's
> there.

A comment wouldn't hurt, I grant you!

> By your argument, one could also claim that c++filt should have
> *unbuffered* output, so that as soon as it has a symbol to demangle,
> it spits it out.  That way, you could use any delimiter, not just
> newlines.

This isn't a bad idea either, but I guess line buffering is preferable
to no buffering for efficiency reasons.  I'm happy to go with the
consensus.

Andrew.

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