Suppress -Wbitwise-instead-of-logical warning that was introduced by clang 14

This commit is contained in:
kobalicek 2022-06-21 23:47:57 +02:00
parent d0cdd70168
commit 06d0badec5
5 changed files with 25 additions and 7 deletions

View File

@ -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
},
{

View File

@ -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" }

View File

@ -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 { \

View File

@ -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");

View File

@ -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++;