From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27910 invoked by alias); 29 Jun 2006 03:16:19 -0000 Received: (qmail 27894 invoked by uid 22791); 29 Jun 2006 03:16:16 -0000 X-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,DK_SIGNED,DNS_FROM_RFC_ABUSE,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from wx-out-0102.google.com (HELO wx-out-0102.google.com) (66.249.82.207) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 29 Jun 2006 03:16:14 +0000 Received: by wx-out-0102.google.com with SMTP id t13so19637wxc for ; Wed, 28 Jun 2006 20:16:11 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iU+guaHKjJX+uQDiWNXj28BOpZVkhzmS3jokA5loi7iep6WHrg6B3OsOvG1SmTTIGlx9IcDpv5eTjQBYHzYLRekWHz91d7hs4EzjDcKDjFNYvbGtDCCI2gyH2FOiz37+eUKp+ZhieOl7Xv4jDvd/Rb86RqpYMQApzeNh4QCc87k= Received: by 10.70.61.19 with SMTP id j19mr2403817wxa; Wed, 28 Jun 2006 20:16:11 -0700 (PDT) Received: by 10.70.34.6 with HTTP; Wed, 28 Jun 2006 20:16:11 -0700 (PDT) Message-ID: Date: Thu, 29 Jun 2006 03:16:00 -0000 From: "James Dickens" To: sourceware-bugzilla@sourceware.org Subject: Re: [Bug tapsets/2861] user_string fault handling Cc: systemtap@sources.redhat.com In-Reply-To: <20060629010846.11620.qmail@sourceware.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20060628164947.2861.hunt@redhat.com> <20060629010846.11620.qmail@sourceware.org> X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00718.txt.bz2 On 29 Jun 2006 01:08:46 -0000, fche at redhat dot com wrote: > > ------- Additional Comments From fche at redhat dot com 2006-06-29 01:08 ------- > > Is there really a need for a caller-specified error message that would > > justify the overhead of the extra strcpy? > > Yes, as a style matter, in order to avoid setting arbitrary english strings as > values that may need to be further processed by script. > > > I'd like to avoid changing all the current code. How about > > > > user_string(addr) ==> returns "" on error shouldn't it return NULL or possibly -1 and then the script then request the exact error code as common with C programming? James Dickens uadmin.blogspot.com > > This works okay only if the returned string is simply going to be passed > straight to an english-speaking user, and not e.g. tested by the script > for its own error-detection purposes. Plus it has no way of telling apart > legal occurrences of the fixed string "" from the error indication. > In the absence of multiple return values and exceptions, letting the caller > specify their favorite soft-error value seems to be he next best thing. > > > user_string(addr, 0) ==> same as above but prints warning > > The ", 0" setting is not helpful (nor is the "0" too informative). We > don't print run-time warnings at the present, and for good reason: they > are only noise. > > > user_string(addr, 1) ==> prints error message and sets lasterr > > I don't find the ", 1" is too informative. > > > Nevertheless, I am not strongly attached to these options, so if others > wish to voice support for hunt's suggestion, or offer new ones, please do. > > > -- > > > http://sourceware.org/bugzilla/show_bug.cgi?id=2861 > > ------- You are receiving this mail because: ------- > You are the assignee for the bug, or are watching the assignee. >