[libcxx-commits] [libcxx] [libc++][hardening] Check that `_LIBCPP_HARDENING_MODE_DEFAULT` is defined (PR #80353)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 1 14:12:17 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Konstantin Varlamov (var-const)
<details>
<summary>Changes</summary>
If the `_LIBCPP_HARDENING_MODE_DEFAULT` macro is not defined, `_LIBCPP_HARDENING_MODE` will be considered defined but fail the check for a valid hardening mode, resulting in a slightly less understandable error (that error is really meant more to prevent users from passing incorrect values such as `0` or `1` directly rather than catching configuration issues).
---
Full diff: https://github.com/llvm/llvm-project/pull/80353.diff
1 Files Affected:
- (modified) libcxx/include/__config (+5)
``````````diff
diff --git a/libcxx/include/__config b/libcxx/include/__config
index d356960e9e62b..2101490c3a8c5 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -325,6 +325,11 @@
// clang-format on
# ifndef _LIBCPP_HARDENING_MODE
+
+# ifndef _LIBCPP_HARDENING_MODE_DEFAULT
+# error _LIBCPP_HARDENING_MODE_DEFAULT is not defined.
+# endif
+
# define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_DEFAULT
# endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/80353
More information about the libcxx-commits
mailing list