diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-07-19 15:46:21 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-07-19 15:46:21 +0000 |
commit | f76e099ca730e6eb7ffe17b28f1aaf88bdedb34e (patch) | |
tree | 7868759c631cb4e8a73b31a4848f385315462d06 /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | 0dcb48eab1737f4801afcba1fec251b20dba8806 (diff) | |
download | bcm5719-llvm-f76e099ca730e6eb7ffe17b28f1aaf88bdedb34e.tar.gz bcm5719-llvm-f76e099ca730e6eb7ffe17b28f1aaf88bdedb34e.zip |
silence a couple of -Wqual-cast warning from GCC (NFC)
Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning
from GCC.
EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual]
Cast to `const uint32_t *` and the explicitly cast away the const-ness
of the value. This seems pretty sketchy as the `DataExtractor` holds a
const reference to the data. However, this is no worse than before.
ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual]
llvm-svn: 308489
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 5607a71ad5a..05ec9f5b19a 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -537,7 +537,8 @@ Symtab *ObjectFilePECOFF::GetSymtab() { // First 4 bytes should be zeroed after strtab_size has been read, // because it is used as offset 0 to encode a NULL string. - uint32_t *strtab_data_start = (uint32_t *)strtab_data.GetDataStart(); + uint32_t *strtab_data_start = const_cast<uint32_t *>( + reinterpret_cast<const uint32_t *>(strtab_data.GetDataStart())); strtab_data_start[0] = 0; offset = 0; |