When I run the following code:
#include int main(int argc, char *argv[]) { int p = 0; p = strcmp(NULL,\"foo\"); return 0; }
What you are doing is undefined. strcmp requires valid pointers to null-terminated strings.
strcmp
NULL is not a pointer to a null-terminated string.
NULL