> g_try_malloc() but you don't bother checking the return value and pass it to
> strcpy()?
We do that all over our code, and this is nothing new. It behaves
identically to the malloc() it replaced.
We also don't check to see if new() returned null or threw a
std::bad_alloc. The alternative to g_try_malloc() is to use
g_malloc(), which will call abort() on failed allocations. Or, we can
litter our code with "if" statements to check for failed allocations.
But these checks can't do anything useful.
So, our choice is between a SIGSEGV and a SIGABRT. That doesn't look
very different to us or to our users. So I'm inclined to let the code
stay as it is.
-- If I ever get out of here, thought of giving it all away. To a registered charity. All I need is a pint a day. If I ever get out of here.Received on Wed May 27 18:01:37 2009
This archive was generated by hypermail 2.1.8 : Wed May 27 2009 - 18:01:37 CEST