Consider:
int main()
{
__asm__("movl $0x1,%%eax;
movl $0x0,%%ebx;
int $0x80;
":::"eax","ebx");
}
I try to simulate the behavior of exit() in Linux. But in modern Linux I find it’s very difficult to do that since some exit handlers will be called after exit().
So I write an old version of exit(). Maybe 10 years ago you can find it in some code.
I compile it with GCC.
gcc -o exit exit.c
And it gives me these messages.
exit.c: In function ‘main’:
exit.c:3:13: warning: missing terminating " character [enabled by default]
exit.c:3:5: error: missing terminating " character
exit.c:4:13: error: expected string literal before ‘movl’
exit.c:6:27: warning: missing terminating " character [enabled by default]
exit.c:6:13: error: missing terminating " character
I have carefully examined my code and I don’t think my code is wrong. So what is that?
You cannot have embedded newlines inside quoted strings
Rewrite as
The preprocessor will join the strings seamlessly, to