Suppose in my Code i use something like this
int iLen = 0;
char *sTmpStr;
strcpy(sTmpStr, "abc");
now i have not alloted any address to pointer. so is there any option in gcc that will show this fault.
i Tried optimisation but it does not gave this error.
i tried -fsanitize=address but it gave error at the run-time something like this
==1982== ERROR: AddressSanitizer: SEGV on unknown address 0x000000c38299 (pc 0x7f78d7b685b0 sp 0x7ffd8918a0b0 bp 0x7f78d7d7a668 T0)
or is there any way i can write this o/p to a file