Hi zturner, granata.enrico,
After syncing to ToT, I started getting this error when cross compiling to an
arm target.
```
/usr/local/google/home/vharron/ll/cross/llvm/tools/lldb/include/lldb/Utility/ProcessStructReader.h:68:74:
error: non-constant-expression cannot be narrowed from type 'unsigned long
long' to 'size_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
m_fields[const_name] = FieldImpl{field_type, byte_index, size};
^~~~
```
This patch adds a cast to fix the error. The cast is non-controversial because
it comes after (size <= 8) is confirmed.
REPOSITORY
rL LLVM
http://reviews.llvm.org/D6814
Files:
include/lldb/Utility/ProcessStructReader.h
Index: include/lldb/Utility/ProcessStructReader.h
===================================================================
--- include/lldb/Utility/ProcessStructReader.h
+++ include/lldb/Utility/ProcessStructReader.h
@@ -65,7 +65,7 @@
return;
ConstString const_name = ConstString(name.c_str());
size_t byte_index = static_cast<size_t>(bit_offset / 8);
- m_fields[const_name] = FieldImpl{field_type, byte_index, size};
+ m_fields[const_name] = FieldImpl{field_type, byte_index,
(size_t)size};
}
size_t total_size = struct_type.GetByteSize();
lldb::DataBufferSP buffer_sp(new DataBufferHeap(total_size,0));
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
Index: include/lldb/Utility/ProcessStructReader.h
===================================================================
--- include/lldb/Utility/ProcessStructReader.h
+++ include/lldb/Utility/ProcessStructReader.h
@@ -65,7 +65,7 @@
return;
ConstString const_name = ConstString(name.c_str());
size_t byte_index = static_cast<size_t>(bit_offset / 8);
- m_fields[const_name] = FieldImpl{field_type, byte_index, size};
+ m_fields[const_name] = FieldImpl{field_type, byte_index, (size_t)size};
}
size_t total_size = struct_type.GetByteSize();
lldb::DataBufferSP buffer_sp(new DataBufferHeap(total_size,0));
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits