libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function-local variables in ltmain


From: Gary V. Vaughan
Subject: Re: function-local variables in ltmain
Date: Tue, 16 Aug 2005 15:06:38 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20050305)

Hallo Ralf,

Ralf Wildenhues wrote:
Welcome back!

Thanks :-)

* Gary V. Vaughan wrote on Tue, Aug 16, 2005 at 01:29:13PM CEST:

Ralf Wildenhues wrote:

* Albert Chin wrote on Sat, Aug 13, 2005 at 09:56:43PM CEST:

On Sat, Aug 13, 2005 at 10:40:01AM +0200, Ralf Wildenhues wrote:

Just look at two examples: func_extract_archives uses variables named
my_*.  This is not safe: both its caller and any functions it may call
itself may overwrite these accidentally.  func_extract_an_archive OTOH
uses safe names f_ex_an_ar_*, but is ugly to the point of being
unreadable.

maintain an m4 map of function name to enumeration encoding, and name the local variables localxx_var_name if output ugliness is a big issue.

This breaks `eval'.  For the above-mentioned functions, that is no
issue.  But it prevents us from using any TAGVARs within such a function
with local variables, for example.

I don't see how... everything would be identical to your solution, except that instead of prepended the function name to m4 local vars, we could name them with a prefix of localxx (where xx is some enumeration guaranteed to be unique by tracking the mapping in an m4 array) for readability.

We might be able to cope with this limitation.  But it's a limitation
that
- "real" local variables do not have

ACK. Maybe we could collaborate with the autoconf guys to hook into the new FEATURES interface to search for a shell that has real local variables?

- my solution does not have

Nor my strawman I believe...

- seems artifical to some point, and dangerous to another: in the m4sh
  source file, this might easily be overlooked!

Agreed.

Cheers,
        Gary.
--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]