The code below works, but I get a "warning: control reaches end of non-void function" warning from GCC. How can I return whatever is in EAX without using an extra variable in the function?
Code:unsigned long get_sp(void)
{
__asm__ __volatile__("movl %esp, %eax\n\t");
}
...
unsigned long sp = get_sp();