Open rplacd opened 1 month ago
PS – I believe long long int
and unsigned long long int
is not strictly in C89, but is a GCC extension of C89, so w2c2_base.h will not compile on a few non-GCC C89-conforming compilers I have at hand (e.g. MetroWerks C 1.1 for Mac 68k.) This isn't a problem for my specific purposes, but it's worth noting.
Hi there – I'm compiling on
arm64-apple-darwin23.5.0
(see end), and using libdwarf 0.10.1 (see end.) Apparently, homebrew, the package manager, aliases libdwarf to dwarfutils. Assuming the version of libdwarf/dwarfutils is what you intended, we get a incompatible function pointer type error when compilingw2c2/debug.c
(see end). Specifically, we use aDwarf_Half
when libdwarf expectsDwarf_Unsigned
, in function pointers that used to initialisestatic const struct Dwarf_Obj_Access_Methods_a_s dwarfAccessMethods
.Assuming that we don't change your intended semantics by using a type with a bigger range, I simply replaced Dwarf_Half with Dwarf_Unsigned in debug.c (patch at end). Then
w2c2_debug
compiles without raising any warnings, and w2c2_test passes all tests. Indeed, the diff between the version of debug.c that compiles and the original (based on commit 22a9ade) is trivial (see end.)I don't have enough experience to know what the root root cause of this issue is; maybe the type of
Dwarf_Obj_Access_Methods_a_s
is platform-conditional. So I simply wanted to report this issue on my platform, and how I resolved it, and leave it up to your best judgment on what to do next.Thanks for this wonderful project. I am getting up to fun adventures with it. rplacd
clang platform info
libdwarf info
cmake error
Patch