summaryrefslogtreecommitdiff
path: root/tools/cppcheck.cfg
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2020-11-20 16:06:23 -0800
committerPhilip Chimento <philip.chimento@gmail.com>2020-11-22 15:13:00 -0800
commit1074a575e55f5b85b1e2e35e7fe110248ad282ce (patch)
tree02de82ae9a661d0e38864a4351807d72f709976a /tools/cppcheck.cfg
parent2fde9dd46394cda25091065d234413af4e75494c (diff)
downloadgjs-1074a575e55f5b85b1e2e35e7fe110248ad282ce.tar.gz
CI: Add cppcheck config file
This is needed because we are about to upgrade to a newer version of cppcheck than the one on the DockerHub image. It ships a "library file" for the GNOME platform, enabling some extra checks when using GLib and GTK APIs. It also requires configuration of some of the macros that we use.
Diffstat (limited to 'tools/cppcheck.cfg')
-rw-r--r--tools/cppcheck.cfg14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/cppcheck.cfg b/tools/cppcheck.cfg
new file mode 100644
index 00000000..184edee1
--- /dev/null
+++ b/tools/cppcheck.cfg
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<def>
+ <define name="GJS_DEFINE_PRIV_FROM_JS" value=""/>
+ <define name="GJS_DEFINE_PROTO_ABSTRACT_WITH_PARENT" value=""/>
+ <!-- These are available in cppcheck 2.0 -->
+ <define name="g_assert_true(expr)" value="g_assert(expr)"/>
+ <define name="g_assert_cmpstr(s1, cmp, s2)" value="g_assert_true(g_strcmp0 ((s1), (s2)) cmp 0)"/>
+ <define name="g_assert_cmpint(n1, cmp, n2)" value="g_assert_true((n1) cmp (n2))"/>
+ <define name="g_assert_cmpuint(n1, cmp, n2)" value="g_assert_true((n1) cmp (n2))"/>
+ <define name="g_assert_cmphex(n1, cmp, n2)" value="g_assert_true((n1) cmp (n2))"/>
+ <define name="g_assert_cmpfloat(n1, cmp, n2)" value="g_assert_true((n1) cmp (n2))"/>
+ <!-- These should be added to cppcheck upstream -->
+ <define name="G_DEFINE_QUARK" value=""/>
+</def>