I was experimenting with GNU C and inline assembly. I kept running into a problem: when I tried to specify a register operand, I received the above error message. For instance, the following simple program failed to compile:
int main(void) { __asm__("mov $0,%%eax"); }
This turned out to be a compiler error. Under certain circumstances, the compiler fails to correctly translate the double percent sign into a single percent sign before passing on the string to the assembler. The obvious solution is to replace double percent signs with single percent signs. However, the problem can also be made to go away by adding a constraints section, even if it is empty:
int main(void) { __asm__("mov $0,%%eax" : ); }