This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: cplus-dem.c tiny patch
- To: dj at delorie dot com
- Subject: Re: cplus-dem.c tiny patch
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 7 Jul 2000 14:08:45 -0000
- CC: binutils at sourceware dot cygnus dot com
> 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.