zrax / pycdc

C++ python bytecode disassembler and decompiler
GNU General Public License v3.0
3.38k stars 646 forks source link

Build error with modern gcc #487

Closed aikawayataro closed 5 months ago

aikawayataro commented 5 months ago

gcc version 14.1.1 20240522 (GCC)

In file included from /pycdc-git/src/pycdc-git/pyc_numeric.h:4,
                 from /pycdc-git/src/pycdc-git/bytecode.cpp:1:
/pycdc-git/src/pycdc-git/pyc_object.h:28:5: error: template-id not allowed for destructor in C++20 [-Werror=template-id-cdtor]
   28 |     ~PycRef<_Obj>()
      |     ^
/pycdc-git/src/pycdc-git/pyc_object.h:28:5: note: remove the ‘< >’
cc1plus: all warnings being treated as errors

I guess -Wno-error=template-id-cdtor will do the trick.

greenozon commented 5 months ago

it's a bit strange to see template param in dtor... have you tried this case:

~PycRef() {
  if (m_obj)
      m_obj->delRef();
}