]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Build with -Werror on most recent gcc and clang.
authorDarren Tucker <dtucker@dtucker.net>
Thu, 21 Oct 2021 04:00:53 +0000 (15:00 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 21 Oct 2021 04:18:34 +0000 (15:18 +1100)
.github/configs
.github/workflows/c-cpp.yml

index 0a1480d5e1d1183dc86421174b3eaa02f89a03d0..90401c9ddc474f97e9afe6b0855f6c4a7e0919a8 100755 (executable)
@@ -29,6 +29,19 @@ case "$config" in
        LIBCRYPTOFLAGS="--without-openssl"
        TEST_TARGET=t-exec
        ;;
+   clang-12-Werror)
+       CC="clang-12"
+       # clang's implicit-fallthrough requires that the code be annotated with
+       # __attribute__((fallthrough)) and does not understand /* FALLTHROUGH */
+       CFLAGS="-Wall -Wextra -O2 -Wno-error=implicit-fallthrough"
+       CONFIGFLAGS="--with-pam --with-Werror"
+       ;;
+    gcc-11-Werror)
+       CC="gcc"
+       # -Wnoformat-truncation in gcc 7.3.1 20180130 fails on fmt_scaled
+       CFLAGS="-Wall -Wextra -Wno-format-truncation -O2 -Wimplicit-fallthrough=4"
+       CONFIGFLAGS="--with-pam --with-Werror"
+       ;;
     clang*|gcc*)
        CC="$config"
        ;;
index 530922f8090e8f9735cedad06443e4ed1bbce04c..f3f897dcc05acabb3b2b8e8f04fa89645acf9431 100644 (file)
@@ -29,11 +29,11 @@ jobs:
           - { os: ubuntu-20.04, configs: clang-9 }
           - { os: ubuntu-20.04, configs: clang-10 }
           - { os: ubuntu-20.04, configs: clang-11 }
-          - { os: ubuntu-20.04, configs: clang-12 }
+          - { os: ubuntu-20.04, configs: clang-12-Werror }
           - { os: ubuntu-20.04, configs: gcc-7 }
           - { os: ubuntu-20.04, configs: gcc-8 }
           - { os: ubuntu-20.04, configs: gcc-10 }
-          - { os: ubuntu-20.04, configs: gcc-11 }
+          - { os: ubuntu-20.04, configs: gcc-11-Werror }
           - { os: ubuntu-20.04, configs: pam }
           - { os: ubuntu-20.04, configs: kitchensink }
           - { os: ubuntu-20.04, configs: hardenedmalloc }