[lldb] Update reinterpret_cast in linux/Host.cpp
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 5 Apr 2022 20:50:12 +0000 (13:50 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 5 Apr 2022 20:52:07 +0000 (13:52 -0700)
Fixes error: reinterpret_cast from type ‘const uint8_t*’ {aka ‘const
unsigned char*’} to type ‘char*’ casts away qualifiers

lldb/source/Host/linux/Host.cpp

index 6342dee..2196b8e 100644 (file)
@@ -133,10 +133,11 @@ static ArchSpec GetELFProcessCPUType(llvm::StringRef exe_path) {
   if (!buffer_sp)
     return ArchSpec();
 
-  uint8_t exe_class = llvm::object::getElfArchType(
-                          {reinterpret_cast<char *>(buffer_sp->GetBytes()),
-                           size_t(buffer_sp->GetByteSize())})
-                          .first;
+  uint8_t exe_class =
+      llvm::object::getElfArchType(
+          {reinterpret_cast<const char *>(buffer_sp->GetBytes()),
+           size_t(buffer_sp->GetByteSize())})
+          .first;
 
   switch (exe_class) {
   case llvm::ELF::ELFCLASS32: