aclements / libelfin

C++11 ELF/DWARF parser
MIT License
314 stars 99 forks source link

build failure with LLVM 10 #44

Open doko42 opened 4 years ago

doko42 commented 4 years ago

fails with LLVM 10, works with LLVM 9:

$ cat x.cpp

include <elf/elf++.hh>

int main(int argc, char *argv[]) { return 0; }

$ clang++ -std=c++11 -I/usr/include/libelfin -c x.cpp In file included from x.cpp:1: In file included from /usr/include/libelfin/elf/elf++.hh:9: /usr/include/libelfin/elf/data.hh:558:22: error: cannot assign to non-static data member within const member function 'set_binding' info = (info & 0xF) | ((unsigned char)v << 4);


/usr/include/libelfin/elf/data.hh:556:14: note: member function 'elf::Sym<elf::Elf64, Order>::set_binding' is declared const here
        void set_binding(stb v) const
        ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
nevun commented 4 years ago
diff --git a/elf/data.hh b/elf/data.hh
index 8085577..d7e9fb4 100644
--- a/elf/data.hh
+++ b/elf/data.hh
@@ -560,7 +560,7 @@ struct Sym<Elf64, Order>
                 return (stb)(info >> 4);
         }

-        void set_binding(stb v) const
+        void set_binding(stb v)
         {
                 info = (info & 0xF) | ((unsigned char)v << 4);
         }
petterreinholdtsen commented 3 years ago

Hi. Any hope to have a new release with this fix in place before Christmas?