summaryrefslogtreecommitdiffstats
path: root/libdwfl
diff options
context:
space:
mode:
authorChih-Hung Hsieh <[email protected]>2015-09-09 12:32:07 -0700
committerMark Wielaard <[email protected]>2015-09-14 13:41:12 +0200
commit2d982861e5e23d38653df7d8dce1d2282cda8ce1 (patch)
tree9b8f87ff115c16043e4a0e41faf4d9ca87795efb /libdwfl
parent879850950bd56255cb5796c86b62bf3bdedd4fb9 (diff)
Remove redundant NULL tests.
GCC6 and Clang give warnings on redundant NULL tests of parameters that are declared with __nonnull_attribute__. Signed-off-by: Chih-Hung Hsieh <[email protected]> Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog8
-rw-r--r--libdwfl/dwfl_frame.c3
-rw-r--r--libdwfl/libdwfl.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 0e3b7862..0ab386fb 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,11 @@
+2015-09-09 Chih-Hung Hsieh <[email protected]>
+ Mark Wielaard <[email protected]>
+
+ * dwfl_frame.c (dwfl_attach_state): Remove redundant NULL tests
+ on parameters declared with __nonnull_attribute__.
+ * libdwfl.h (dwfl_module_getelf): Don't mark first argument as
+ nonnull.
+
2015-09-08 Mark Wielaard <[email protected]>
* libdwflP.h (struct __libdwfl_pid_arg): Add elf and elf_fd.
diff --git a/libdwfl/dwfl_frame.c b/libdwfl/dwfl_frame.c
index f6f86c0d..a91a1d68 100644
--- a/libdwfl/dwfl_frame.c
+++ b/libdwfl/dwfl_frame.c
@@ -143,7 +143,8 @@ dwfl_attach_state (Dwfl *dwfl, Elf *elf, pid_t pid,
/* Reset any previous error, we are just going to try again. */
dwfl->attacherr = DWFL_E_NOERROR;
- if (thread_callbacks == NULL || thread_callbacks->next_thread == NULL
+ /* thread_callbacks is declared NN */
+ if (thread_callbacks->next_thread == NULL
|| thread_callbacks->set_initial_registers == NULL)
{
dwfl->attacherr = DWFL_E_INVALID_ARGUMENT;
diff --git a/libdwfl/libdwfl.h b/libdwfl/libdwfl.h
index 1098c833..aea8b993 100644
--- a/libdwfl/libdwfl.h
+++ b/libdwfl/libdwfl.h
@@ -423,7 +423,7 @@ extern int dwfl_validate_address (Dwfl *dwfl,
with the difference between addresses within the loaded module
and those in symbol tables or Dwarf information referring to it. */
extern Elf *dwfl_module_getelf (Dwfl_Module *, GElf_Addr *bias)
- __nonnull_attribute__ (1, 2);
+ __nonnull_attribute__ (2);
/* Return the number of symbols in the module's symbol table,
or -1 for errors. */