Hi All,
This may look like a trivial problem. Sorry in that case, I am not able to find the actual way. I understand that automatic variable are un-initilaized. So a code snippet provided below is likely to dump in block-2
char *p;
if(NULL == p)
{
//do something block-1 statement
}
else
{
//do something else block-2 statement
}
Now, in most of the platform the default value of the automatic variable is either 0 or NULL especially SUSE Linux flavours.
Question
a. Is there any compiler flag or any other option which will force the setting up of local variable to a "junk" value if un-initialized?
PS : I know that static analyzer tool will be easily able to detect the problem. I just wanted to know if this can be done at run time also through some flags/option setting.
I am using SUSE 10/HP-UX and AIX platforms.