-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
When compiling with -Wconversion and -Wsign-conversion, the generated code results in some worrisome warnings about type conversions.
The main culprit seems to be the size_type in LoanableCollection:
class LoanableCollection
{
public:
using size_type = int32_t;This is mixed with size_t in the generated code which is unsigned. ( https://en.cppreference.com/w/c/types/size_t.html )
Does LoanableCollection::size_type really have to be signed?
This warning goes away if one changes this to size_t.
Would it be possible to change this to simply size_t?
Examples in the generated code
length() being int32_t here but returned as size_t:
SWIGINTERN size_t eprosima_fastdds_dds_LoanableSequence_Sl_HelloWorld_Sc_std_false_type_Sg____len__(eprosima::fastdds::dds::LoanableSequence< HelloWorld,std::false_type > const *self){
return self->length();
}Operator being fed i of type size_t:
SWIGINTERN HelloWorld const &eprosima_fastdds_dds_LoanableSequence_Sl_HelloWorld_Sc_std_false_type_Sg____getitem__(eprosima::fastdds::dds::LoanableSequence< HelloWorld,std::false_type > const *self,size_t i){
return (*self)[i];
}Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels