[PATCH] D86166: sanitizer_common: Use void* for madvise first argument on Solaris.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 10:56:14 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa208ad5ddb5b: sanitizer_common: Use void* for madvise first argument on Solaris. (authored by pcc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86166/new/

https://reviews.llvm.org/D86166

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp


Index: compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -76,10 +76,16 @@
 
 // Illumos' declaration of madvise cannot be made visible if _XOPEN_SOURCE
 // is defined as g++ does on Solaris.
-extern "C" int madvise(caddr_t, size_t, int);
+//
+// This declaration is consistent with Solaris 11.4. Both Illumos and Solaris
+// versions older than 11.4 declared madvise with a caddr_t as the first
+// argument, but we don't currently support Solaris versions older than 11.4,
+// and as mentioned above the declaration is not visible on Illumos so we can
+// use any declaration we like on Illumos.
+extern "C" int madvise(void *, size_t, int);
 
 int internal_madvise(uptr addr, uptr length, int advice) {
-  return madvise((caddr_t)addr, length, advice);
+  return madvise((void *)addr, length, advice);
 }
 
 DECLARE__REAL_AND_INTERNAL(uptr, close, fd_t fd) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86166.286613.patch
Type: text/x-patch
Size: 1055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200819/5099a85e/attachment.bin>


More information about the llvm-commits mailing list