This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2][BZ #832][BZ #3266] Make ldd try_trace more robust and portable
- From: "Patrick 'P. J.' McDermott" <pj+sourceware-ml at pehjota dot net>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 10 Sep 2013 18:27:23 -0400
- Subject: Re: [PATCH v2][BZ #832][BZ #3266] Make ldd try_trace more robust and portable
- Authentication-results: sourceware.org; auth=none
- References: <522B4A29 dot 3060509 at pehjota dot net> <201309101702 dot 21701 dot vapier at gentoo dot org> <522F8FE5 dot 3060908 at pehjota dot net> <201309101756 dot 39649 dot vapier at gentoo dot org>
On 2013-09-10 17:56, Mike Frysinger wrote:
> On Tuesday 10 September 2013 17:32:21 Patrick 'P. J.' McDermott wrote:
>> I discussed this in the original thread [1]. There are shells that
>> don't support local, so I'd rather avoid using it. I proposed using a
>> subshell as you've suggested (though the outside curly braces aren't
>> necessary on any shell, as far as I know â either way the function is
>> defined as a compound list of commands). At the time, though, no one
>> indicated any preferences. So I think I'll adjust this to use a
>> subshell.
>
> i use this style as it's what people are used to -- they have in their mind
> that a func must be bracketed by {...}.
Ah. Personally, I found the outside curly braces more confusing. :)
> if you do choose to omit those, please make sure to add an explicit comment so
> future peeps don't get confused.
> # The use of (...) vs {...} for the body of the func is by design -- we
> # want a subshell to avoid the vars leaking into the caller.
> try_trace() (
> ....
> )
Yes, that's reasonable. Will do.
--
Patrick "P. J." McDermott
http://www.pehjota.net/
Lead Developer, ProteanOS
http://www.proteanos.com/