This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: PATCH: Do not call xmalloc_failed in expandargv


>   	  if (!*argvp)
> ! 	    {
> ! 	      fprintf (stderr, "\n%sout of memory\n");
> ! 	      xexit (1);
> ! 	    }

I seem to recall a general policy (before my time) that libiberty
functions shouldn't ever exit on error; the proper response is to
return some error condition to the application.  Since expandargv()
doesn't have an error response, IMHO the right thing to do is treat
@foo as if it weren't a file and just return the original argv[n].
The application will hopefully discover the out of memory condition
itself and use its own handlers to deal with it.


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