diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-05-23 20:28:53 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-05-23 20:31:18 -0300 |
commit | 9e2eadb1d779c53db08a8b65066388c30d877403 (patch) | |
tree | 91d059159d943965fa58a43edc79ab9c1fa90db5 /libkmod/libkmod-elf.c | |
parent | a70c1e774e595039c321c1c2e99d43e4c9bd0fa8 (diff) | |
download | kmod-9e2eadb1d779c53db08a8b65066388c30d877403.tar.gz |
Silence clang warnings with __unused__ attribute
I hate this kind of READV and WRITEV macros that Gustavo seems to love.
clang-analyzer hates them as well.
I'm not motivated enough to refactor this, but I want a clean clang
report, so just shut it up.
Diffstat (limited to 'libkmod/libkmod-elf.c')
-rw-r--r-- | libkmod/libkmod-elf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c index f8a5d15..38e83c1 100644 --- a/libkmod/libkmod-elf.c +++ b/libkmod/libkmod-elf.c @@ -243,12 +243,12 @@ static inline int elf_get_section_info(const struct kmod_elf *elf, uint16_t idx, elf_get_uint(elf, off + offsetof(typeof(*hdr), field), sizeof(hdr->field)) if (elf->class & KMOD_ELF_32) { - const Elf32_Shdr *hdr = (const Elf32_Shdr *)p; + const Elf32_Shdr *hdr _unused_ = (const Elf32_Shdr *)p; *size = READV(sh_size); *offset = READV(sh_offset); *nameoff = READV(sh_name); } else { - const Elf64_Shdr *hdr = (const Elf64_Shdr *)p; + const Elf64_Shdr *hdr _unused_ = (const Elf64_Shdr *)p; *size = READV(sh_size); *offset = READV(sh_offset); *nameoff = READV(sh_name); @@ -311,12 +311,12 @@ struct kmod_elf *kmod_elf_new(const void *memory, off_t size) elf->header.strings.section = READV(e_shstrndx); \ elf->header.machine = READV(e_machine) if (elf->class & KMOD_ELF_32) { - const Elf32_Ehdr *hdr = elf_get_mem(elf, 0); + const Elf32_Ehdr *hdr _unused_ = elf_get_mem(elf, 0); LOAD_HEADER; hdr_size = sizeof(Elf32_Ehdr); shdr_size = sizeof(Elf32_Shdr); } else { - const Elf64_Ehdr *hdr = elf_get_mem(elf, 0); + const Elf64_Ehdr *hdr _unused_ = elf_get_mem(elf, 0); LOAD_HEADER; hdr_size = sizeof(Elf64_Ehdr); shdr_size = sizeof(Elf64_Shdr); @@ -561,11 +561,11 @@ int kmod_elf_strip_section(struct kmod_elf *elf, const char *section) #define WRITEV(field, value) \ elf_set_uint(elf, off + offsetof(typeof(*hdr), field), sizeof(hdr->field), value) if (elf->class & KMOD_ELF_32) { - const Elf32_Shdr *hdr = buf; + const Elf32_Shdr *hdr _unused_ = buf; uint32_t val = ~(uint32_t)SHF_ALLOC; return WRITEV(sh_flags, val); } else { - const Elf64_Shdr *hdr = buf; + const Elf64_Shdr *hdr _unused_ = buf; uint64_t val = ~(uint64_t)SHF_ALLOC; return WRITEV(sh_flags, val); } |