From 428d0147bcfa05bd68c0af33db6ccc15acd3adf0 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Thu, 22 Nov 2018 14:04:22 +0100 Subject: [PATCH] wxwidgets.cfg: Added support for wxSizer::Add(). --- cfg/wxwidgets.cfg | 19 +++++++++++++++++++ test/cfg/wxwidgets.cpp | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/cfg/wxwidgets.cfg b/cfg/wxwidgets.cfg index e14253ee8..8d6b53f50 100644 --- a/cfg/wxwidgets.cfg +++ b/cfg/wxwidgets.cfg @@ -937,6 +937,25 @@ + + + false + + + + + + + + + + + + + + + + diff --git a/test/cfg/wxwidgets.cpp b/test/cfg/wxwidgets.cpp index 9d2e01976..eec87699f 100644 --- a/test/cfg/wxwidgets.cpp +++ b/test/cfg/wxwidgets.cpp @@ -21,6 +21,7 @@ #include #include #include +#include void validCode() { @@ -77,7 +78,26 @@ void nullPointer(const wxString &str) unsigned long long * ulongLongPtr = NULL; // cppcheck-suppress nullPointer (void)str.ToULongLong(ulongLongPtr); +} +void nullPointer_wxSizer_Add(wxSizer &sizer, wxWindow *w) +{ + wxWindow * const ptr = 0; + // cppcheck-suppress nullPointer + sizer.Add(ptr); + // No warning shall be issued for + sizer.Add(w); +} + +void uninitvar_wxSizer_Add(wxSizer &sizer, wxWindow *w,wxObject* userData ) +{ + int uninit; + // cppcheck-suppress uninitvar + sizer.Add(w,uninit); + // cppcheck-suppress uninitvar + sizer.Add(w,4,uninit); + // cppcheck-suppress uninitvar + sizer.Add(w,4,2,uninit,userData); } void ignoredReturnValue(const wxString &s)