diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e19b50f..10f0416 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -29,5 +29,5 @@ jobs: - name: Test run: | cd build - ctest -VV -C ${{ matrix.build_type }} + ctest -C ${{ matrix.build_type }} cd .. diff --git a/elfio/elfio_dynamic.hpp b/elfio/elfio_dynamic.hpp index 4919ca5..636e700 100644 --- a/elfio/elfio_dynamic.hpp +++ b/elfio/elfio_dynamic.hpp @@ -201,7 +201,7 @@ template 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 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 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( &entry ), sizeof( entry ) ); diff --git a/elfio/elfio_versym.hpp b/elfio/elfio_versym.hpp index 6e99877..575d720 100644 --- a/elfio/elfio_versym.hpp +++ b/elfio/elfio_versym.hpp @@ -33,7 +33,8 @@ template 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 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; } } diff --git a/tests/ELFIOTest2.cpp b/tests/ELFIOTest2.cpp index 8b52763..ddf4689 100644 --- a/tests/ELFIOTest2.cpp +++ b/tests/ELFIOTest2.cpp @@ -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"];