c:\test>cl test.cpp /analyze Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved.
test.cpp c:\test\test.cpp(14) : warning C6292: Ill-defined for-loop: counts up from maximum c:\test\test.cpp(14) : warning C6201: Index '100' is out of valid index range '0' to '99' for possibly stack allocated buffer 'buf' c:\test\test.cpp(15) : warning C6031: Return value ignored: 'CalcSum' c:\test\test.cpp(14) : warning C6386: Buffer overrun: accessing 'buf', the writable size is '800' bytes, but '808' bytes might be written: Lines: 13, 14 c:\test\test.cpp(21) : warning C6202: Buffer overrun for 'buf', which is possibly stack allocated, in call to 'GetEnvironmentVariableW': length '512' exceeds buffer size '510' c:\test\test.cpp(21) : warning C6386: Buffer overrun: accessing 'argument 2', the writable size is '510' bytes, but '512' bytes might be written: Lines: 20, 21 Microsoft (R) Incremental Linker Version 8.00.50727.762 Copyright (C) Microsoft Corporation. All rights reserved.