Author: Jonas Devlieghere
Date: 2022-04-05T13:52:07-07:00
New Revision: a722dea4af7743a76701bb582ded88fe0e188c14

URL: 
https://github.com/llvm/llvm-project/commit/a722dea4af7743a76701bb582ded88fe0e188c14
DIFF: 
https://github.com/llvm/llvm-project/commit/a722dea4af7743a76701bb582ded88fe0e188c14.diff

LOG: [lldb] Update reinterpret_cast in linux/Host.cpp

Fixes error: reinterpret_cast from type ‘const uint8_t*’ {aka ‘const
unsigned char*’} to type ‘char*’ casts away qualifiers

Added: 
    

Modified: 
    lldb/source/Host/linux/Host.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp
index 6342dee59532a..2196b8ed5a3f1 100644
--- a/lldb/source/Host/linux/Host.cpp
+++ b/lldb/source/Host/linux/Host.cpp
@@ -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:


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to