This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: broken macro argument separation
>>> On 27.10.10 at 15:43, Nick Clifton <nickc@redhat.com> wrote:
> Hi Jan,
>
>> .macro m arg1 arg2=0
>> .long \arg1, \arg2
>> .endm
>
>> 9 m 1 -2 +3
>> 9 0018 01000000 > .long 1,-2+3
>
>> i.e. white space between a number and '-' is retained while white
>> space between a number and '+' isn't.
>
>> Suggestions/opinions anyone?
>
> How about having the assembler issue a warning message when an operator
> character is interpreted as a macro argument separator ? The warning
> could be disabled via a command line switch, but it would alert
> assembler programmers to the behaviour if they were unaware of it.
Hmm, no, splitting arguments at operand characters is always an
error, and I don't think it happens anymore. Splitting at white
space is where the problem is, combined with cpp inserting
blanks between numbers and +, -, or . when the number was a
result of a macro expansion, and with the behavior of gas'
scrubber (eliminating blanks conditionally), which together
makes things rather unpredictable for the programmer.
Jan