[PATCH v2][BZ #832][BZ #3266] Make ldd try_trace more robust and portable
Patrick 'P. J.' McDermott
pj+sourceware-ml@pehjota.net
Tue Sep 10 22:27:00 GMT 2013
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/
More information about the Libc-alpha
mailing list