diff options
author | kobalicek <kobalicek.petr@gmail.com> | 2022-06-22 00:47:57 +0300 |
---|---|---|
committer | kobalicek <kobalicek.petr@gmail.com> | 2022-06-22 01:30:34 +0300 |
commit | 06d0badec53710a4f572cf5642881ce570c5d274 (patch) | |
tree | d53eb8d65bedfa6d859d69c42e989386499dd544 | |
parent | d0cdd70168852a00234760ed980a9cda2f5fabc7 (diff) |
Suppress -Wbitwise-instead-of-logical warning that was introduced by clang 14
-rw-r--r-- | .github/workflows/build-config.json | 4 | ||||
-rw-r--r-- | .github/workflows/build.yml | 10 | ||||
-rw-r--r-- | src/asmjit/core/api-config.h | 10 | ||||
-rw-r--r-- | test/asmjit_test_assembler.cpp | 4 | ||||
-rw-r--r-- | test/asmjit_test_assembler.h | 4 |
5 files changed, 25 insertions, 7 deletions
diff --git a/.github/workflows/build-config.json b/.github/workflows/build-config.json index 2be4612..08022ef 100644 --- a/.github/workflows/build-config.json +++ b/.github/workflows/build-config.json @@ -16,11 +16,11 @@ "optional": true }, { - "cmd": ["asmjit_test_assembler", "--quiet"], + "cmd": ["asmjit_test_assembler"], "optional": true }, { - "cmd": ["asmjit_test_assembler", "--quiet", "--validate"], + "cmd": ["asmjit_test_assembler", "--validate"], "optional": true }, { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94d6796..7ae9ad0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: include: - - { title: "linux-lib" , os: "ubuntu-latest" , cc: "clang" , arch: "x64", build_type: "Release", problem_matcher: "cpp" } + - { title: "linux-lib" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x64", build_type: "Release", problem_matcher: "cpp" } - { title: "windows-lib" , os: "windows-2022" , cc: "vs2022" , arch: "x86", build_type: "Debug" , problem_matcher: "cpp" } - { title: "diag-asan" , os: "ubuntu-latest" , cc: "clang" , arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON", diagnostics: "address" } @@ -91,6 +91,14 @@ jobs: - { title: "linux" , os: "ubuntu-20.04" , cc: "clang-12", arch: "x86", build_type: "Release", defs: "ASMJIT_TEST=ON" } - { title: "linux" , os: "ubuntu-20.04" , cc: "clang-12", arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } - { title: "linux" , os: "ubuntu-20.04" , cc: "clang-12", arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-13", arch: "x86", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-13", arch: "x86", build_type: "Release", defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-13", arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-13", arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x86", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x86", build_type: "Release", defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } + - { title: "linux" , os: "ubuntu-22.04" , cc: "clang-14", arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } - { title: "macos-10.15" , os: "macos-10.15" , cc: "gcc-9" , arch: "x64", build_type: "Debug" , defs: "ASMJIT_TEST=ON" } - { title: "macos-10.15" , os: "macos-10.15" , cc: "gcc-9" , arch: "x64", build_type: "Release", defs: "ASMJIT_TEST=ON" } diff --git a/src/asmjit/core/api-config.h b/src/asmjit/core/api-config.h index a0fb979..57b4a79 100644 --- a/src/asmjit/core/api-config.h +++ b/src/asmjit/core/api-config.h @@ -481,6 +481,16 @@ namespace asmjit { #if defined _DOXYGEN #define ASMJIT_BEGIN_NAMESPACE namespace asmjit { #define ASMJIT_END_NAMESPACE } +#elif defined(__clang_major__) && __clang_major__ >= 14 + #define ASMJIT_BEGIN_NAMESPACE \ + namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE { \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wbitwise-instead-of-logical\"") \ + _Pragma("clang diagnostic ignored \"-Wconstant-logical-operand\"") \ + _Pragma("clang diagnostic ignored \"-Wunnamed-type-template-args\"") + #define ASMJIT_END_NAMESPACE \ + _Pragma("clang diagnostic pop") \ + }} #elif defined(__clang__) #define ASMJIT_BEGIN_NAMESPACE \ namespace asmjit { inline namespace ASMJIT_ABI_NAMESPACE { \ diff --git a/test/asmjit_test_assembler.cpp b/test/asmjit_test_assembler.cpp index 4b40a75..17a9c3b 100644 --- a/test/asmjit_test_assembler.cpp +++ b/test/asmjit_test_assembler.cpp @@ -26,7 +26,7 @@ int main(int argc, char* argv[]) { CmdLine cmdLine(argc, argv); TestSettings settings {}; - settings.quiet = cmdLine.hasArg("--quiet"); + settings.verbose = cmdLine.hasArg("--verbose"); settings.validate = cmdLine.hasArg("--validate"); printf("AsmJit Assembler Test-Suite v%u.%u.%u:\n\n", @@ -37,7 +37,7 @@ int main(int argc, char* argv[]) { printf("Usage:\n"); printf(" --help Show usage only\n"); printf(" --arch=<ARCH> Select architecture to run ('all' by default)\n"); - printf(" --quiet Show only assembling errors [%s]\n", settings.quiet ? "x" : " "); + printf(" --verbose Log all instruction tests [%s]\n", settings.verbose ? "x" : " "); printf(" --validate Use instruction validation [%s]\n", settings.validate ? "x" : " "); printf("\n"); diff --git a/test/asmjit_test_assembler.h b/test/asmjit_test_assembler.h index 61d774b..7a37a47 100644 --- a/test/asmjit_test_assembler.h +++ b/test/asmjit_test_assembler.h @@ -10,7 +10,7 @@ #include <stdio.h> struct TestSettings { - bool quiet; + bool verbose; bool validate; }; @@ -73,7 +73,7 @@ public: return false; } - if (!settings.quiet) + if (settings.verbose) printf(" OK [%s] <- %s\n", encodedOpcode.data(), s); passed++; |