[cfe-dev] (Weird?) assembly macro expansion

Hermann Loose hermannloose at googlemail.com
Tue Jun 19 06:16:51 PDT 2012


Hi,

I have a question regarding assembly macro expansion in Clang. Google
hasn't been helpful in turning up documentation and before I start
investing a lot of time in reading source, I thought I'd ask for a quick
pointer here.

We have code like this in our kernel:

.macro DO_SYSEXIT
addl $8, %esp /* skip ecx & edx */
...

Now Clang seems to interpret $8 as an insertion point for a (non-existing)
parameter, which leads to the following error:

<instantiation>:1:6: error: unknown token in expression
addl , %esp
     ^

Question: why?

I haven't found any documentation concerning this, any pointers or
explanations will be vastly appreciated, as I don't want to go to town on
our code and change everything to addl $$8, ... which works, but that's not
the way it should be, right? Disclaimer: I really don't have any experience
with assembly, from what I know I assume that Clang uses AT&T syntax?

Thanks in advance,
Hermann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120619/d5eacb9c/attachment.html>


More information about the cfe-dev mailing list