(I have moved the discussion to the gnulib mailing list; bug-coreutils is BCC'ed)
On Fri, Feb 22, 2008 at 9:27 AM, Jim Meyering <[EMAIL PROTECTED]> wrote: > No. I note your subsequent mail, and yes, I was indeed thinking about oversized allocations. > This function is intended to be usable from a library. > I.e., no fair calling exit, which xnrealloc does when it fails. > > Also, the function header comment says what happens > when it fails, and "exit" is not mentioned. While I have read many times on this list people mentioning this issue, I just didn't think about it when I wrote my previous mail. I could easily have written code using xnrealloc, and contributed to the problem of library code calling exit. It occurs to me that quite a bit of effort goes into checking for and fixing that kind of thing. It strikes me that if gnulib modules had a "not allowed to call exit" property, we could probably use a topologically sorted list of gnulib object modules to determine if a given module could call exit (or _Exit, _exit, abort, ...). That property could be verified against the declared property in the module definition automatically. Similar approaches could work for related constraints (for example, one might require modules intended to be thread-safe not to call chdir(2)). This sounds like an interesting project; I may find some time to work on it during March. James. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils