This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: scoping of numeric local labels in assembler macros
- From: Ian Lance Taylor <ian at airs dot com>
- To: Greg McGary <greg at mcgary dot org>
- Cc: binutils at sources dot redhat dot com
- Date: 07 Jun 2002 17:59:10 -0700
- Subject: Re: scoping of numeric local labels in assembler macros
- References: <msvg8u7foq.fsf@mcgary.org>
Greg McGary <greg@mcgary.org> writes:
> I have the displeasure of working with a large collection of assembler
> macros, which are often nested. They make liberal use of
> small-integer local labels which are vulnerable to collisions. (E.g.,
> macro A calls macro B, both use label `1', so A silently branches to a
> location in B, rather than the intended destination in A)
>
> It occurs to me that it would be useful if local labels could be
> scoped within macros. Has this been discussed before? If I implement
> it, will the community want the changes? Since this is a major change
> in semantics, it will only be enabled by a command-line option, and
> off by default.
You should be able to use \@ in the label name within the macro
definition to avoid this problem.
Ian