[libcxx-commits] [libcxx] [libc++][Android] Disable fdsan in filebuf close.pass.cpp (PR #102412)
Dan Albert via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 8 16:23:34 PDT 2024
================
@@ -24,6 +19,15 @@
#include "test_macros.h"
#include "platform_support.h"
+// If we're building for a lower __ANDROID_API__, the Bionic versioner will
+// omit the function declarations from fdsan.h. We might be running on a newer
+// API level, though, so declare the API function here using weak.
+#if defined(__BIONIC__)
+#include <android/fdsan.h>
+enum android_fdsan_error_level android_fdsan_set_error_level(enum android_fdsan_error_level new_level)
----------------
DanAlbert wrote:
Annoying that you can't use `-D __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__` for this one. If you want to match that behavior more closely, instead of making this weak, pass that anyway and then use `__INTRODUCED_IN` here? You'd also want `-Werror=unguarded-availabilty`. More or less the same behavior, but the callsite would then be `__builtin_available` like it would be if this feature worked properly in bionic, and means that some day when we do fix that the change to this file will just be deleting the duplicate prototype (if even that).
Not really a big deal, but it's an alternative if you prefer it.
https://github.com/llvm/llvm-project/pull/102412
More information about the libcxx-commits
mailing list