#include <string.h>
void testok(void) reentrant { char buff[20];
buff[0]=1;
strcpy(buff,"hello");
//ok: buff = "hello"
}
void testfail(void) reentrant { char buff[20];
buff[0]=1; buff[2]=2;
//fail: buff = "ello"
void main(void) { testok(); testfail(); }
Not strcpy () error asm view call strcpy, the buff (mov Rx) address error
It cannot be in error, because the whole code is you posted is functionally equivalent to
void main(void) { // do nothing // OH, and by the way, what do you think happens after this line? }
It doesn't matter one bit how the compiler invoked strcpy(), nor even whether it called strcpy() at all, because immediately after that line in the source the lifetime of the affected variable ends anyway. So whatever happened to this variable doesn't matter.
so pc programs that do return don't do anything?
Whether or not they do return has nothing to do with it. But yes, it's possible to write a seemingly complex PC program that still ends up being functionally equivalent to
int main(void) { return 0; }