Address warnings reported by Windows compilation

This commit is contained in:
Serge Lamikhov-Center 2022-02-26 01:51:49 +02:00
parent 9fb99af870
commit 1e6d24d40e
4 changed files with 11 additions and 8 deletions

View File

@ -29,5 +29,5 @@ jobs:
- name: Test
run: |
cd build
ctest -VV -C ${{ matrix.build_type }}
ctest -C ${{ matrix.build_type }}
cd ..

View File

@ -201,7 +201,7 @@ template <class S> class dynamic_section_accessor_template
case DT_SYMBOLIC:
case DT_TEXTREL:
case DT_BIND_NOW:
entry.d_un.d_val = convertor( 0 );
entry.d_un.d_val = convertor( decltype( entry.d_un.d_val )( 0 ) );
break;
case DT_NEEDED:
case DT_PLTRELSZ:
@ -219,7 +219,8 @@ template <class S> class dynamic_section_accessor_template
case DT_RUNPATH:
case DT_FLAGS:
case DT_PREINIT_ARRAYSZ:
entry.d_un.d_val = convertor( value );
entry.d_un.d_val =
convertor( decltype( entry.d_un.d_val )( value ) );
break;
case DT_PLTGOT:
case DT_HASH:
@ -235,11 +236,12 @@ template <class S> class dynamic_section_accessor_template
case DT_FINI_ARRAY:
case DT_PREINIT_ARRAY:
default:
entry.d_un.d_ptr = convertor( value );
entry.d_un.d_ptr =
convertor( decltype( entry.d_un.d_val )( value ) );
break;
}
entry.d_tag = convertor( tag );
entry.d_tag = convertor( decltype( entry.d_tag )( tag ) );
dynamic_section->append_data( reinterpret_cast<char*>( &entry ),
sizeof( entry ) );

View File

@ -33,7 +33,8 @@ template <class S> class versym_section_accessor_template
versym_section_accessor_template( S* section ) : versym_section( section )
{
if ( section ) {
entries_num = section->get_size() / sizeof( Elf_Half );
entries_num = decltype( entries_num )( section->get_size() /
sizeof( Elf_Half ) );
}
}
@ -118,7 +119,7 @@ template <class S> class versym_r_section_accessor_template
if ( dynamic_section_acc.get_entry( i, tag, value, str ) &&
tag == DT_VERNEEDNUM ) {
entries_num = value;
entries_num = (Elf_Word)value;
break;
}
}

View File

@ -374,7 +374,7 @@ TEST( ELFIOTest, gnu_version_64_le )
section* gnu_version = reader.sections[".gnu.version"];
const_versym_section_accessor gnu_version_arr( gnu_version );
section* gnu_version_r = reader.sections[".gnu.version_r"];
const section* gnu_version_r = reader.sections[".gnu.version_r"];
const_versym_r_section_accessor gnu_version_r_arr( reader, gnu_version_r );
section* dynstr = reader.sections[".dynstr"];