strange error message about GCC inline assembly

前端 未结 2 2017
面向向阳花
面向向阳花 2021-01-15 13:46
int main()
{
    __asm__(\"movl $0x1,%%eax;
            movl $0x0,%%ebx;
            int $0x80;
            \":::\"eax\",\"ebx\");
}

I try to simul

2条回答
  •  半阙折子戏
    2021-01-15 14:39

    You cannot have embedded newlines inside quoted strings

    // bad
    "two
    lines"
    

    Rewrite as

    // good
    "two\n"
    "lines"
    

    The preprocessor will join the strings seamlessly, to

    "two\nlines"
    

提交回复
热议问题