This is the mail archive of the gcc-patches@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: verbose terminate() on by default


On Mon, Dec 23, 2002 at 07:15:32PM -0500, Phil Edwards wrote:
> On Mon, Dec 23, 2002 at 08:41:36PM +0100, Gabriel Dos Reis wrote:
> > Daniel Jacobowitz <drow@mvista.com> writes:
> > 
> > | Step back... Phil, your most recent patch just changed eh_terminate.cc,
> > | if I'm looking at the right message.  That's in libsupc++.  But
> > | verbose_terminate is in libstdc++.  I see a problem there; libsupc++
> > | should not have link dependency on libstdc++, that defeats the point,
> > | doesn't it?
> > 
> > Good catch!
> > 
> > But src/cterminate.cc should have been put in libsupc++/ in the first
> > place.   
> 
> I agree.  I wonder why nobody noticed this last year.
> 
> 
> > It currenlty uses:
> > 
> >    * free() // to free the storage allocated by the demangler
> >    * abort() // which is already used in libsupc++
> 
> I'm not worried about either of those.  The routine used to deallocate
> memory will probably have to be generalized if we start using Carlo's
> less-buggy demangler.
> 
> 
> >    * fprintf() // which might be effcienly replaced by write() or puts().
> 
> Replacing it with fputs() still brings in the stdio library.  Although I
> think that it would still be an improvement, since it doesn't do string
> interpretation and wouldn't (in theory) pull in as much stuff as fprtinf(),
> assuming a well-divisioned stdio library.
> 
> Replacing it with write() would be a bad step, I think.  Now we have
> multiple system calls, instead of a single one done after formatting.
> Unless we want to format the string into a buffer ourselves before calling
> write() once... at which point we're back to using fprintf.

I'd agree, but for two things:
 - If we want to format in a buffer, all you're ever using is %s.  It
doesn't get any easier.
 - This is v_Terminate_.  Do we care if it has three write syscalls?


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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