]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Disable compound-token-split-by-macro warning with Clang
authorMichal Nowak <mnowak@isc.org>
Mon, 30 May 2022 16:53:09 +0000 (18:53 +0200)
committerMichal Nowak <mnowak@isc.org>
Mon, 5 Dec 2022 15:00:35 +0000 (16:00 +0100)
Perl DLZ module compilation with Clang produces the following warning:

    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                         ^~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/perl.h:666:29: note: expanded from macro 'STMT_START'
    #   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                                  ^
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:150:5: note: '{' token is here
        ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/lib/x86_64-linux-gnu/perl/5.32/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                    ^

(cherry picked from commit 69b7e4362d091d68e478e1c0080a0ce3640af78f)

.gitlab-ci.yml

index 6354d2ff5d8257eeec3b6db38a4362b0d4fbc375..b7a9706435b6be2c6bc66a59ba9ca67abbbe6d1d 100644 (file)
@@ -1085,12 +1085,14 @@ unit:clang:tsan:
       artifacts: true
 
 # Jobs for Clang builds on Debian 11 "bullseye" (amd64)
+# The -Wno-compound-token-split-by-macro option prevents warning when compiling
+# Perl DLZ module with Clang against Perl older than version 5.35.2.
 
 clang:bullseye:amd64:
   variables:
     BUILD_CONTRIB: 1
     CC: ${CLANG}
-    CFLAGS: "${CFLAGS_COMMON} -Wenum-conversion"
+    CFLAGS: "${CFLAGS_COMMON} -Wenum-conversion -Wno-compound-token-split-by-macro"
     EXTRA_CONFIGURE: "--with-python=python3"
     RUN_MAKE_INSTALL: 1
   <<: *debian_bullseye_amd64_image