[PATCH] D52717: [NFC] Fix `-Wcast-qual` warnings in Darwin `internal_sysctl(...)` implementation.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 09:54:38 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL343496: [NFC] Fix `-Wcast-qual` warnings in Darwin `internal_sysctl(...)`… (authored by delcypher, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D52717

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc


Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
@@ -215,8 +215,8 @@
 
 int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
                     uptr *oldlenp, const void *newp, uptr newlen) {
-  return sysctl((int *)name, namelen, oldp, (size_t *)oldlenp, (void *)newp,
-                (size_t)newlen);
+  return sysctl(const_cast<int *>(name), namelen, oldp, (size_t *)oldlenp,
+                const_cast<void *>(newp), (size_t)newlen);
 }
 
 int internal_forkpty(int *amaster) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52717.167757.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181001/bebd6919/attachment.bin>


More information about the llvm-commits mailing list