[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 04:17:26 PDT 2018


delcypher created this revision.
delcypher added reviewers: kubamracek, george.karpenkov, krytarowski.
Herald added a subscriber: Sanitizers.

The warnings were introduced in r341187 and r341192.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D52717

Files:
  lib/sanitizer_common/sanitizer_mac.cc


Index: lib/sanitizer_common/sanitizer_mac.cc
===================================================================
--- lib/sanitizer_common/sanitizer_mac.cc
+++ 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.167698.patch
Type: text/x-patch
Size: 651 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181001/b172548f/attachment.bin>


More information about the llvm-commits mailing list