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

Eli Friedman eli.friedman at gmail.com
Wed Jun 20 16:55:13 PDT 2012

On Tue, Jun 19, 2012 at 6:16 AM, Hermann Loose
<hermannloose at googlemail.com> wrote:
> 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?

Can you give a complete testcase and the output of clang --version?


More information about the cfe-dev mailing list