pcb

Comment 4 for bug 699146

Revision history for this message
Peter Clifton (pcjc2) wrote :

I'm not sure who DJ directed those questions at.

I'll put forward my opinion:

1. We don't care about fprintf failing.. It is unlikely to happen, and if it does - what are we going to do about it.. print a message?
2. exit() and abort() are to be avoided, but a fair response as a result of malloc failure
3. Possibly, but we don't have a lot of spare cycles for it. If you wanted to look at static analysis of the code-base, we'd be happy to incorporate any fixes that discovers.
4. I don't think so at this time. It is possible we may move to C++ at some point, and that may be up for rediscussion then, but for now I personally prefer to handle errors in the "old fashioned" way (or ignore them ;))

Currently our malloc strategy appears to be that it will succeed - or we will crash pretty quickly if NULL is returned. This is how glib encourages us to behave in the GTK HID, as g_malloc will exit if it fails.