If you only have one stack, and the stack is at the top of memory and it grows down, you can:
int onstackp(void*x){char a;return x>&a;}
If you only have one stack, and the stack is at the top of memory and it grows down, you can: