From fbaa4d5b0c47a4129ff7e514bdecc284635b36e9 Mon Sep 17 00:00:00 2001 From: kasperk81 <83082615+kasperk81@users.noreply.github.com> Date: Sat, 15 Oct 2022 21:24:11 +0000 Subject: fix more warnings --- include/dwarf.h | 2 +- src/coredump/ucd_file_table.c | 2 +- src/dwarf/Gexpr.c | 4 ++-- src/dwarf/Gfind_unwind_table.c | 2 +- src/x86_64/Ginit.c | 2 +- tests/test-coredump-unwind.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/dwarf.h b/include/dwarf.h index 23ff4c4f..dd9014b7 100644 --- a/include/dwarf.h +++ b/include/dwarf.h @@ -422,7 +422,7 @@ extern int dwarf_search_unwind_table (unw_addr_space_t as, int need_unwind_info, void *arg); extern int dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as, - char *path, unw_word_t segbase, unw_word_t mapoff, + const char *path, unw_word_t segbase, unw_word_t mapoff, unw_word_t ip); extern void dwarf_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg); diff --git a/src/coredump/ucd_file_table.c b/src/coredump/ucd_file_table.c index 15e07047..cde693db 100644 --- a/src/coredump/ucd_file_table.c +++ b/src/coredump/ucd_file_table.c @@ -189,7 +189,7 @@ ucd_file_table_dispose (ucd_file_table_t *ucd_file_table) { if (ucd_file_table->uft_files != NULL) { - for (int i = 0; i < ucd_file_table->uft_count; ++i) + for (size_t i = 0; i < ucd_file_table->uft_count; ++i) { ucd_file_dispose(&ucd_file_table->uft_files[i]); } diff --git a/src/dwarf/Gexpr.c b/src/dwarf/Gexpr.c index 22747c63..882f4dac 100644 --- a/src/dwarf/Gexpr.c +++ b/src/dwarf/Gexpr.c @@ -578,8 +578,8 @@ if (stackerror) \ case DW_OP_neg: Debug (15, "OP_neg\n"); - unw_word_t tmp UNUSED = pop (); - push (~tmp + 1); + tmp1 = pop (); + push (~tmp1 + 1); break; case DW_OP_not: diff --git a/src/dwarf/Gfind_unwind_table.c b/src/dwarf/Gfind_unwind_table.c index ad9b4e9a..fb20fea0 100644 --- a/src/dwarf/Gfind_unwind_table.c +++ b/src/dwarf/Gfind_unwind_table.c @@ -37,7 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ int dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as, - char *path, unw_word_t segbase, unw_word_t mapoff, + const char *path, unw_word_t segbase, unw_word_t mapoff, unw_word_t ip) { Elf_W(Phdr) *phdr, *ptxt = NULL, *peh_hdr = NULL, *pdyn = NULL; diff --git a/src/x86_64/Ginit.c b/src/x86_64/Ginit.c index e75f92a5..88146a3e 100644 --- a/src/x86_64/Ginit.c +++ b/src/x86_64/Ginit.c @@ -79,7 +79,7 @@ static int mem_validate_pipe[2] = {-1, -1}; static inline void do_pipe2 (int pipefd[2]) { - pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); + int result UNUSED = pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); } #else static inline void diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c index b0c1bf51..5c296004 100644 --- a/tests/test-coredump-unwind.c +++ b/tests/test-coredump-unwind.c @@ -141,7 +141,7 @@ static void verror_msg_helper(const char *s, if (flags & LOGMODE_STDIO) { fflush(stdout); - write(STDERR_FILENO, msg, used + msgeol_len); + ssize_t written UNUSED = write(STDERR_FILENO, msg, used + msgeol_len); } msg[used] = '\0'; /* remove msg_eol (usually "\n") */ if (flags & LOGMODE_SYSLOG) -- cgit v1.2.1