Re: malloc failure and errno

2007-09-09 Thread Roland McGrath
> What is the reason? Can malloc() return NULL with errno being set to something > different than ENOMEM? It is probably just overly-conservative code in those callers.

Re: getline.h

2007-09-09 Thread Bruno Haible
Eric Blake wrote: > Here's what I'm committing; I think it addresses all your points. > > 2007-08-22 Eric Blake <[EMAIL PROTECTED]> > > Getline touchups. > * lib/getdelim.c (getdelim): Revert regression that required *n to > be 0 when *lineptr is NULL. Preserve errno across f

Re: add dependencies to malloc-posix or realloc-posix

2007-09-09 Thread Bruno Haible
Jim Meyering wrote: > You've expanded gnulib's set of target systems to include some with > non-conforming malloc functions. Coreutils does indeed not attempt portability to mingw. However, gettext and libiconv do support mingw since 2006; other packages relying on gnulib maybe did so earlier tha

Re: missing check for malloc NULL result

2007-09-09 Thread Jim Meyering
> At these places malloc/realloc/calloc NULL results are not well handled, IIUC. I fixed the hash.c one: http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=summary * lib/hash.c (hash_initialize): Detect calloc failure. Reported by Bruno Haible.

Re: missing check for malloc NULL result

2007-09-09 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > Hi, > > At these places malloc/realloc/calloc NULL results are not well handled, IIUC. > > Sergey: > argp-help.c:440 > argp-help.c:463 > argp-help.c:464 > argp-help.c:877 > argp-help.c:880 > Simon: > gc-gnulib.c:583 > Jim: > hash.c:578 Good

Re: add dependencies to malloc-posix or realloc-posix

2007-09-09 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > I found these missing dependencies. If you disagree to these dependencies, > you are free to remove them and set errno to ENOMEM manually in the .c file. > > 2007-09-09 Bruno Haible <[EMAIL PROTECTED]> > > * modules/getcwd (Depends-on): Add malloc-p

canonicalize-lgpl: set errno

2007-09-09 Thread Bruno Haible
The 'canonicalize-lgpl' module should better not rely on malloc-posix or realloc-posix, otherwise it adds extra complexity to the 'relocatable' module family. Setting errno = ENOMEM is the more maintainable solution here. 2007-09-09 Bruno Haible <[EMAIL PROTECTED]> * lib/canonicalize-l

add dependencies to malloc-posix or realloc-posix

2007-09-09 Thread Bruno Haible
Hi, I found these missing dependencies. If you disagree to these dependencies, you are free to remove them and set errno to ENOMEM manually in the .c file. 2007-09-09 Bruno Haible <[EMAIL PROTECTED]> * modules/getcwd (Depends-on): Add malloc-posix. * modules/glob (Depends-on):

missing check for malloc NULL result

2007-09-09 Thread Bruno Haible
Hi, At these places malloc/realloc/calloc NULL results are not well handled, IIUC. Sergey: argp-help.c:440 argp-help.c:463 argp-help.c:464 argp-help.c:877 argp-help.c:880 Simon: gc-gnulib.c:583 Jim: hash.c:578 Paul: regcomp.c:864 regcomp.c:3030 missing cleanup action, leaks memo

Re: malloc failure and errno

2007-09-09 Thread Bruno Haible
Jim Meyering wrote: > POSIX guarantees that errno is defined when malloc or realloc > fails, so there's no need to set it manually in that case. Yet glibc does set it manually in some cases: glibc-2.6.1/login/openpty.c:69 glibc-2.6.1/login/login.c:67 glibc-2.6.1/stdlib/setenv.c:180 glibc-2.6.1/sy

new modules 'malloc-posix', 'realloc-posix', 'calloc-posix'

2007-09-09 Thread Bruno Haible
Jim Meyering wrote: > > So I propose to add three modules 'malloc-posix', 'realloc-posix', > > 'calloc-posix' (using the '-posix' suffix that we already know from > > 'fnmatch-posix'/'fnmatch-gnu' and 'printf-posix'). > > I'm glad you've seen the light! :-) I take this as an OK to the proposal, s

gnulib-tool: new option --extract-notice

2007-09-09 Thread Bruno Haible
Jim Meyering wrote on 2007-09-04: > How about adding a way to tell gnulib-tool > that a module (or just one of its names) is deprecated. Then, assuming > both malloc and malloc-gnu module names are accepted and equivalent > for several months -- while gnulib-tool emits warnings[*] -- remove the >

gnulib-tool: new options --verbose, --quiet

2007-09-09 Thread Bruno Haible
Jim Meyering wrote on 2007-09-04: > Currently, gnulib-tool emits so much output that > a few new diagnostics may easily go by unnoticed. This has been mentioned several times lately. I'm adding an option --quiet that decreases the verbosity and an option --verbose that cancels --quiet (and vice ve