[epiphany/mcatanzaro/cppcheck: 1/12] Adjust cppcheck output



commit f801e69826d264214e6a4795acd6362f70330fd1
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Nov 17 09:37:16 2019 -0600

    Adjust cppcheck output
    
    Using --template=gcc allows us to see error IDs so that we can suppress
    false positives.
    
    Also, add a bunch of suppressions for warnings that cppcheck is bad at
    handling. Sadly, the most important warnings, like null pointer
    dereference, are prone to many false positives, making them impractical
    for us to use. There's even a false positive for returning uninitialized
    memory (in a situation where we have to drop our reference to the return
    value before returning, where cppcheck can't distinguish between unref and
    free, I suppose).
    
    We also suppress warnings about non-casted NULL pointers at the end of a
    variadic argument list. This is undefined behavior -- to avoid UB, we
    should use (char *)NULL instead -- but glib depends on it and nothing
    will work if this isn't allowed, so we had better ignore.

 .gitlab-ci.yml | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 476b592b4..d41612f18 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,8 +19,25 @@ cppcheck:
   allow_failure: true
   before_script:
     - apk update && apk add cppcheck
-  script:
-    - cppcheck --enable=all --suppress=variableScope --suppress=unusedFunction --force -q . 
--error-exitcode=1 --library=gtk
+  script: >-
+    cppcheck .
+    --enable=all
+    --error-exitcode=1
+    --library=gtk
+    --quiet
+    --suppress=constArgument
+    --suppress=ctunullpointer
+    --suppress=deallocret
+    --suppress=leakNoVarFunctionCall
+    --suppress=memleak
+    --suppress=missingInclude
+    --suppress=nullPointer
+    --suppress=variableScope
+    --suppress=unusedFunction
+    --suppress=varFuncNullUB
+    --suppress=*:lib/contrib/gvdb/*
+    --suppress=*:subprojects/*
+    --template=gcc
 
 variables:
   BUNDLE: 'epiphany-git.flatpak'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]