[lttng-dev] [PATCH lttng-ust] Fix: remove NULL check of nonnull parameter in dlclose

Antoine Busque abusque at efficios.com
Mon May 9 20:33:29 UTC 2016


 The `handle` parameter of `dlclose`, as defined in
 `include/lttng/ust-dlfcn.h` is marked `__nonnull`. GCC starting with
 version 6.1 emits warnings for comparisons of nonnull arguments
 against NULL by default (see -Wnonnull-compare).

 Therefore, this removes a superfluous NULL check on `handle`, for
 which GCC emitted a warning.

Signed-off-by: Antoine Busque <abusque at efficios.com>
---
 liblttng-ust-dl/lttng-ust-dl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/liblttng-ust-dl/lttng-ust-dl.c b/liblttng-ust-dl/lttng-ust-dl.c
index 954d9df..ac3c951 100644
--- a/liblttng-ust-dl/lttng-ust-dl.c
+++ b/liblttng-ust-dl/lttng-ust-dl.c
@@ -144,7 +144,7 @@ void *dlopen(const char *filename, int flag)
 
 int dlclose(void *handle)
 {
-	if (__tracepoint_ptrs_registered && handle) {
+	if (__tracepoint_ptrs_registered) {
 		struct link_map *p = NULL;
 		int ret;
 
-- 
2.8.2



More information about the lttng-dev mailing list