From 26607a4a9c8b2c039ccc79bfe745af73e8f4b45e Mon Sep 17 00:00:00 2001 From: Peter Goodman Date: Sun, 8 Nov 2020 18:05:09 -0500 Subject: [PATCH] Wrap headers in some ugly pragmas for disabling error checks. Helps integration with downstream projects --- include/remill/Arch/Arch.h | 12 ++++++++++-- include/remill/BC/Annotate.h | 7 +++++++ include/remill/BC/Optimizer.h | 7 +++++++ include/remill/BC/Util.h | 12 +++++++++--- include/remill/BC/Version.h | 7 +++++++ 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/include/remill/Arch/Arch.h b/include/remill/Arch/Arch.h index 74ee5ca58..c16159961 100644 --- a/include/remill/Arch/Arch.h +++ b/include/remill/Arch/Arch.h @@ -17,12 +17,20 @@ #pragma once // clang-format off -#include "remill/BC/Compat/CTypes.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wconversion" +#pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wdocumentation" +#pragma clang diagnostic ignored "-Wswitch-enum" +#include +#include + #include #include #include #include -#include +#pragma clang diagnostic pop // clang-format on #include diff --git a/include/remill/BC/Annotate.h b/include/remill/BC/Annotate.h index 575c89972..39b3e4b20 100644 --- a/include/remill/BC/Annotate.h +++ b/include/remill/BC/Annotate.h @@ -16,9 +16,16 @@ #pragma once +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wconversion" +#pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wdocumentation" +#pragma clang diagnostic ignored "-Wswitch-enum" #include #include #include +#pragma clang diagnostic pop #include #include diff --git a/include/remill/BC/Optimizer.h b/include/remill/BC/Optimizer.h index 0a5a2e6ac..2906fd9b1 100644 --- a/include/remill/BC/Optimizer.h +++ b/include/remill/BC/Optimizer.h @@ -16,7 +16,14 @@ #pragma once +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wconversion" +#pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wdocumentation" +#pragma clang diagnostic ignored "-Wswitch-enum" #include +#pragma clang diagnostic pop #include #include diff --git a/include/remill/BC/Util.h b/include/remill/BC/Util.h index 41bf783a3..2127da727 100644 --- a/include/remill/BC/Util.h +++ b/include/remill/BC/Util.h @@ -17,11 +17,17 @@ #pragma once // clang-format off -#include "remill/BC/Compat/CTypes.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wconversion" +#pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wdocumentation" +#pragma clang diagnostic ignored "-Wswitch-enum" +#include #include #include #include - +#pragma clang diagnostic pop // clang-format on #include @@ -31,7 +37,7 @@ #include #include -#include "remill/BC/ABI.h" +#include namespace llvm { class Argument; diff --git a/include/remill/BC/Version.h b/include/remill/BC/Version.h index 231af6d68..0b20adaa9 100644 --- a/include/remill/BC/Version.h +++ b/include/remill/BC/Version.h @@ -16,7 +16,14 @@ #pragma once +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-conversion" +#pragma clang diagnostic ignored "-Wconversion" +#pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wdocumentation" +#pragma clang diagnostic ignored "-Wswitch-enum" #include +#pragma clang diagnostic pop #define LLVM_VERSION(major, minor) ((major * 100) + minor)