Attached is a simple file that demonstrate two failures discovered when running SSA:
- SSA failed to detect the memory leak caused by failure to call fclose(). In real code, this would cause a loss of resources (memory and file handles) which would eventually cause a failure.
- SSA gives the following error, which appears to be a false positive:
Error 12038: illegal value passed to "fopen_s" in argument 3
I would also like to report a missing option in the on-line documentation. Under Compiler Option Descriptions, the -Qdiag-file option is missing.
messages to be output to stderr
C:\Program Files (x86)\Intel\ComposerXE-2011\Documentation\en_US\compiler_c\cl\index.htm
Causes the results of diagnostic analysis to be output to a file.
I think you'd have to state more explicitly what is missing.
Let me see if we can duplicate the issue here. Thanks for reporting it with a testcase.
Maybe you left the file open on purpose?
Maybe handle is to a console input or output and should not be closed?
Maybe file pointer is a global variable and you close the file elsewhere?
Since this particular function with missing fclose() is called only once, not doing an explicit fclose() before the program end is not a catastrophic error -- C runtime will close all open handles on exit anyway so there will be no resource leak. If you called it inside of a loop, then not detecting missing fclose() would be a serious issue.