<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: ????; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hi,</div><div>I am using clang static analyzer in Microsoft Visual C++ projects, but I found it very time-consuming when analyzing MFC cpp files. I found too many warnings in MFC include files, looks like:</div><div><div>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\atlsimpstr.h(800,3): warning:</div><div>      Returned pointer value points outside the original object (potential buffer overflow)</div><div>                return( reinterpret_cast< CStringData* >( m_pszData )-1 );</div><div>                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include\atlsimpstr.h(900,3): warning:</div><div>      Returned pointer value points outside the original object (potential buffer overflow)</div><div>                return( pNewData );</div><div>                ^~~~~~~~~~~~~~~~~~</div><div>AlexfPerf.cpp(190,8): warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access</div><div>      errors or data corruption</div><div>        pot = (PPERF_OBJECT_TYPE)((PBYTE)pdb + pdb->HeaderLength);</div></div><div>......</div><div><br></div><div>So, I'm thinking if clang is analyzing too much on these system header files. How to have clang avoid to analyze them?</div><div><br></div><div>Thanks,</div><div><br></div><div>Johnson Haul</div>
</body></html>