#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(); }
I do not think you are right. the header file only has the prototype. not the implementation. lots of compiler have the source to libraries and you can change. they can be changed. you probably thinking of intrinsic.
they can be changed.
And any change that makes the function called strcpy() behave differently from the C Standard's requirement causes undefined behaviour.
you probably thinking of intrinsic.
No.
no. it just not same as what you call standard. in the real world if you define the function it is not undefined behaviour. of course it assumes you KNOW how to write a proper function. you probably dont. LOL.
It is undefined behaviour if you include the support for CRTL and then perform something different than the CRTL function as described in the standard.
no. it just not same as what you call standard.
You seem to be beyond learning something new, but I'll drop you a few hints anyway.
*) It's not what I call standard, it is the Standard. There's a reason I spell it like that. *) You're incorrect in believing that you would get to decide what is undefined behaviour.
you probably dont. LOL. You really have no idea.
Lol. Don't get upset little man. I know more than you think I think.