From 8b94bfaf0a1fca3efee01f1be922e1c77f45328c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 24 May 2018 14:52:32 +0200 Subject: [PATCH] windows.cfg: Add macros SUCCEEDED() and FAILED(). (#1264) Somehow the opposite inner condition is not detected when macros are used. I created this ticket: https://trac.cppcheck.net/ticket/8596 --- cfg/windows.cfg | 4 ++++ test/cfg/windows.cpp | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/cfg/windows.cfg b/cfg/windows.cfg index 551b5c1a1..44a97e5b1 100644 --- a/cfg/windows.cfg +++ b/cfg/windows.cfg @@ -5349,4 +5349,8 @@ HFONT CreateFont( + + + + diff --git a/test/cfg/windows.cpp b/test/cfg/windows.cpp index b3e376452..c46a31246 100644 --- a/test/cfg/windows.cpp +++ b/test/cfg/windows.cpp @@ -706,3 +706,12 @@ void uninitvar_towupper(_locale_t l) // cppcheck-suppress uninitvar (void)_towupper_l(i, l); } + +void oppositeInnerCondition_SUCCEEDED_FAILED(HRESULT hr) +{ + if (SUCCEEDED(hr)) { + // TODO ticket #8596 cppcheck-suppress oppositeInnerCondition + if (FAILED(hr)) { + } + } +}