cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1957?usp=email )
Change subject: cppcheck: Fix handling of likely() on Windows ...................................................................... cppcheck: Fix handling of likely() on Windows Since we do not force __GNUC__ to undefined on Windows (since we want to support MinGW) cppcheck might stumble upon __builtin_expect(). When running with gnu.cfg (which we do not want to do for Windows code) then that has an existing override. But for our Windows checks we need to add our own override. This caused false-positives in buffer code. Change-Id: I3b835558451414d8a4e8058114643555be69d391 Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Arne Schwabe <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1957 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg39555.html Signed-off-by: Gert Doering <[email protected]> --- A dev-tools/openvpn-cppcheck-windows.cfg M dev-tools/run-cppcheck.sh 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dev-tools/openvpn-cppcheck-windows.cfg b/dev-tools/openvpn-cppcheck-windows.cfg new file mode 100644 index 0000000..9ac7282 --- /dev/null +++ b/dev-tools/openvpn-cppcheck-windows.cfg @@ -0,0 +1,10 @@ +<?xml version ="1.0"?> +<!-- Only used for the Windows run. Can't be in openvpn-cppcheck-library.cfg + because it conflicts with gnu.cfg. --> +<def> + <!-- MinGW uses GCC, so we need to handle GCC builtins. gnu.cfg has these, + but we do not load it for Windows. Without this cppcheck does not + understand our likely()/unlikely() macros. --> + <define name="__builtin_expect(X,Y)" value="(X)" /> + <define name="__builtin_expect_with_probability(exp,c,probability)" value="(exp)" /> +</def> diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh index 4c4ba2c..ad012ac 100755 --- a/dev-tools/run-cppcheck.sh +++ b/dev-tools/run-cppcheck.sh @@ -49,7 +49,7 @@ tests/unit_tests/plugins/ || ret=$? cppcheck $COMMON_ARGS \ --platform=win64 \ - --library=windows.cfg \ + --library=windows.cfg --library=${SCRIPT_DIR}/openvpn-cppcheck-windows.cfg \ -D_WIN32 \ -UTARGET_LINUX -UTARGET_FREEBSD -UTARGET_OPENBSD -UTARGET_NETBSD \ -UTARGET_DARWIN -UTARGET_ANDROID -UTARGET_SOLARIS -UTARGET_DRAGONFLY \ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1957?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I3b835558451414d8a4e8058114643555be69d391 Gerrit-Change-Number: 1957 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld <[email protected]> Gerrit-Reviewer: plaisthos <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
