From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13639 invoked by alias); 27 Sep 2005 15:40:38 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13519 invoked by uid 22791); 27 Sep 2005 15:40:28 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 27 Sep 2005 15:40:28 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j8RFeRW7019076; Tue, 27 Sep 2005 11:40:27 -0400 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j8RFeQV22386; Tue, 27 Sep 2005 11:40:26 -0400 Received: from greed.delorie.com (dj.cipe.redhat.com [10.0.0.222]) by post-office.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j8RFeNP19967; Tue, 27 Sep 2005 11:40:23 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.13.1/8.13.1) with ESMTP id j8RFeJLV016493; Tue, 27 Sep 2005 11:40:19 -0400 Received: (from dj@localhost) by greed.delorie.com (8.13.1/8.13.1/Submit) id j8RFeBbf016490; Tue, 27 Sep 2005 11:40:11 -0400 Date: Tue, 27 Sep 2005 15:40:00 -0000 Message-Id: <200509271540.j8RFeBbf016490@greed.delorie.com> From: DJ Delorie To: mark@codesourcery.com CC: gdb@sources.redhat.com, gdb-patches@sources.redhat.com, ian@airs.com In-reply-to: <200509271451.j8REpKeg029702@sethra.codesourcery.com> (message from Mark Mitchell on Tue, 27 Sep 2005 07:51:20 -0700) Subject: Re: PATCH: Do not call xmalloc_failed in expandargv References: <200509271451.j8REpKeg029702@sethra.codesourcery.com> X-SW-Source: 2005-09/txt/msg00215.txt.bz2 > 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.