From d46cd46d0f3f52cc2048bd532bd634e620b6512d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 23 Jan 2018 15:45:06 +0100 Subject: [PATCH] windows.cfg: Add _countof macro configuration (#1047) By telling cppcheck about the Microsoft Windows _countof() macro it is now able to detect out of bounds array accesses like this: wchar_t buf[10]; for(size_t i = 0; i <= (_countof(buf)); ++i) { buf[i] = L'\0'; // (error) Array 'buf[10]' accessed at index 10, which is out of bounds. } --- cfg/windows.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 947ad91bc..fb5c3dc79 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -4060,4 +4060,5 @@ HFONT CreateFont( +