[compiler-rt] 254f931 - [NFC][sanitizer] Fix veradic-macro warning in RAW_CHECK
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 17 18:11:02 PST 2021
Author: Vitaly Buka
Date: 2021-11-17T18:10:54-08:00
New Revision: 254f9311fe05897ec9ef600c81112f85f9d8c95d
URL: https://github.com/llvm/llvm-project/commit/254f9311fe05897ec9ef600c81112f85f9d8c95d
DIFF: https://github.com/llvm/llvm-project/commit/254f9311fe05897ec9ef600c81112f85f9d8c95d.diff
LOG: [NFC][sanitizer] Fix veradic-macro warning in RAW_CHECK
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index e97cc9ac0df1..d0db0129d4af 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -300,7 +300,8 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond,
} \
} while (0)
-#define RAW_CHECK(expr, ...) RAW_CHECK_MSG(expr, #expr "\n", __VA_ARGS__)
+#define RAW_CHECK(expr) RAW_CHECK_MSG(expr, #expr "\n", )
+#define RAW_CHECK_VA(expr, ...) RAW_CHECK_MSG(expr, #expr "\n", __VA_ARGS__)
#define CHECK_IMPL(c1, op, c2) \
do { \
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp
index 79aee8ba6282..3a9e366d2df9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp
@@ -191,12 +191,12 @@ int VSNPrintf(char *buff, int buff_length,
break;
}
case 'p': {
- RAW_CHECK(!have_flags, kPrintfFormatsHelp, format);
+ RAW_CHECK_VA(!have_flags, kPrintfFormatsHelp, format);
result += AppendPointer(&buff, buff_end, va_arg(args, uptr));
break;
}
case 's': {
- RAW_CHECK(!have_length, kPrintfFormatsHelp, format);
+ RAW_CHECK_VA(!have_length, kPrintfFormatsHelp, format);
// Only left-justified width is supported.
CHECK(!have_width || left_justified);
result += AppendString(&buff, buff_end, left_justified ? -width : width,
@@ -204,17 +204,17 @@ int VSNPrintf(char *buff, int buff_length,
break;
}
case 'c': {
- RAW_CHECK(!have_flags, kPrintfFormatsHelp, format);
+ RAW_CHECK_VA(!have_flags, kPrintfFormatsHelp, format);
result += AppendChar(&buff, buff_end, va_arg(args, int));
break;
}
case '%' : {
- RAW_CHECK(!have_flags, kPrintfFormatsHelp, format);
+ RAW_CHECK_VA(!have_flags, kPrintfFormatsHelp, format);
result += AppendChar(&buff, buff_end, '%');
break;
}
default: {
- RAW_CHECK(false, kPrintfFormatsHelp, format);
+ RAW_CHECK_VA(false, kPrintfFormatsHelp, format);
}
}
}
More information about the llvm-commits
mailing list