When building master GDB, I ran into the following:
binutils-gdb/gdb/bt-utils.c: In function 'int libbacktrace_print(void*, uintptr_t, const char*, int, const char*)':
binutils-gdb/gdb/bt-utils.c:93:44: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'uintptr_t {aka unsigned int}' [-Werror=format=]
snprintf (buf, sizeof (buf), "0x%lx ", pc);
Fix this by using %PRIxPTR as opposed to %lx.
files. We are also careful to ensure we don't overflow this buffer. */
char buf[20];
- snprintf (buf, sizeof (buf), "0x%lx ", pc);
+ snprintf (buf, sizeof (buf), "0x%" PRIxPTR " ", pc);
buf[sizeof (buf) - 1] = '\0';
sig_write (buf);
sig_write (function == nullptr ? "???" : function);