Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Nov 9, 2023
1 parent fcf5dae commit 77b94c0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Build SDK
shell: bash
env:
CLICOLOR_FORCE: "1"
MACOSX_DEPLOYMENT_TARGET: "11.0"
CCACHE_DIR: ${{ runner.temp }}/.ccache
CCACHE_MAXSIZE: 10.0G
Expand Down Expand Up @@ -99,6 +100,8 @@ jobs:
LIEF_BUILD_DIR: "/tmp/lief-build"
PYLIEF_CONF: "${{ github.workspace }}/scripts/osx/osx-testing-x64.toml"
CLICOLOR_FORCE: "1"
PYTEST_ADDOPTS: "--color=yes"
FORCE_COLOR: "1"
MACOSX_TARGET: "11.7"
MACOSX_DEPLOYMENT_TARGET: "11.0"
CCACHE_DIR: ${{ runner.temp }}/.ccache
Expand Down Expand Up @@ -165,6 +168,8 @@ jobs:
shell: bash
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
FORCE_COLOR: "1"
CLICOLOR_FORCE: "1"
CCACHE_DIR: ${{ runner.temp }}/.ccache
CCACHE_MAXSIZE: 10.0G
CCACHE_CPP2: 1
Expand Down
1 change: 0 additions & 1 deletion src/BinaryStream/ASN1Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ result<bool> ASN1Reader::is_tag(int tag) {
result<size_t> ASN1Reader::read_tag(int tag) {
size_t out = 0;

const uint8_t* cur_p = stream_.p();
uint8_t* p = stream_.p();
const uint8_t* end = stream_.end();

Expand Down
1 change: 0 additions & 1 deletion src/ELF/Builder.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,6 @@ ok_error_t Builder::build_symbol_definition() {
using Elf_Half = typename ELF_T::Elf_Half;
using Elf_Word = typename ELF_T::Elf_Word;
using Elf_Addr = typename ELF_T::Elf_Addr;
using Elf_Off = typename ELF_T::Elf_Off;

using Elf_Verdef = typename ELF_T::Elf_Verdef;
using Elf_Verdaux = typename ELF_T::Elf_Verdaux;
Expand Down
6 changes: 3 additions & 3 deletions src/ELF/Parser.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ ok_error_t Parser::parse_binary() {
}

if (auto res = binary_->virtual_address_to_offset(virtual_address)) {
auto parsing_result = type == DYNAMIC_TAGS::DT_RELA ?
parse_pltgot_relocations<ELF_T, typename ELF_T::Elf_Rela>(*res, size) :
parse_pltgot_relocations<ELF_T, typename ELF_T::Elf_Rel>(*res, size);
type == DYNAMIC_TAGS::DT_RELA ?
parse_pltgot_relocations<ELF_T, typename ELF_T::Elf_Rela>(*res, size) :
parse_pltgot_relocations<ELF_T, typename ELF_T::Elf_Rel>(*res, size);
binary_->sizing_info_->jmprel = size;
} else {
LIEF_WARN("Can't convert DT_JMPREL.virtual_address into an offset (0x{:x})", virtual_address);
Expand Down
4 changes: 3 additions & 1 deletion src/MachO/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ ok_error_t Parser::undo_reloc_bindings(uintptr_t base_address) {
for (std::unique_ptr<Binary>& bin : binaries_) {
for (Relocation& reloc : bin->relocations()) {
if (RelocationFixup::classof(reloc)) {
auto& fixup = static_cast<RelocationFixup&>(reloc);
/* TODO(romain): We should support fixup
* auto& fixup = static_cast<RelocationFixup&>(reloc);
*/
}
else if (RelocationDyld::classof(reloc)) {
span<const uint8_t> content = bin->get_content_from_virtual_address(reloc.address(), sizeof(uintptr_t));
Expand Down
4 changes: 1 addition & 3 deletions src/MachO/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ bool check_valid_paths(const Binary& binary, std::string* error) {
case LOAD_COMMAND_TYPES::LC_ID_DYLIB:
{
has_install_name = true;
/*
* Fallback
*/
[[fallthrough]];
}
case LOAD_COMMAND_TYPES::LC_LOAD_DYLIB:
case LOAD_COMMAND_TYPES::LC_LOAD_WEAK_DYLIB:
Expand Down

0 comments on commit 77b94c0

Please sign in to comment.