This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: scoping of numeric local labels in assembler macros


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]