diff options
author | Colomban Wendling <[email protected]> | 2023-11-15 10:04:39 +0100 |
---|---|---|
committer | Colomban Wendling <[email protected]> | 2025-03-12 09:45:10 +0100 |
commit | 58ae1c5beea52417b7d3b41ca66a08889d1c8786 (patch) | |
tree | 6450901cfafaf3651d04ab629646e263b2adba0a | |
parent | ab21c38cfcc721aa20575c267a14b083db64b5a2 (diff) | |
download | mate-panel-58ae1c5beea52417b7d3b41ca66a08889d1c8786.tar.bz2 mate-panel-58ae1c5beea52417b7d3b41ca66a08889d1c8786.tar.xz |
github-actions: Further improve cppcheck accuracy
Teach cppcheck the C11 _Noreturn attribute.
-rw-r--r-- | .github/workflows/build.yml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef38961a..1d54b658 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -236,6 +236,16 @@ jobs: # - Wayland-related stuff # - in-process for Wayland # - optional features + # - _Noreturn: this is to avoid false positive with functions that + # don't return, like g_assert(false). Here, we rely on G_NORETURN + # (GLib 2.68+) using _Noreturn C11 attribute if __STDC_VERSION__ is + # high enough (cppcheck sets it for us in newer versions, but not on + # here yet); but the version of cppcheck we run on don't know about + # the C11 attribute, so map it to the GCC one it does know. + # This is a tad over-specific, but it removes some spurious warnings, + # and defining e.g. __GNUC__=12 is simpler, but is a *lot* slower + # (more than 3 times slower), and doesn't seem to yield other + # benefits for the moment. # - -I flags from pkg-config (grepped from configure.ac) # - ignore non-source directories - name: cppcheck @@ -248,6 +258,7 @@ jobs: -DHAVE_WINDOW_PREVIEWS -DHAVE_LANGINFO_H -DHAVE_NL_LANGINFO -DGETTEXT_PACKAGE="mate-panel" + -D__STDC_VERSION__=201112 -D_Noreturn=__attribute__((__noreturn__)) packages: > gdk-pixbuf-2.0 gio-unix-2.0 |