[tin-dev] [PATCH] compiler warnings II

Dennis Preiser dennis at d--p.de
Mon Nov 20 20:34:39 CET 2023


The following compiler warning could be silenced with the patch below.

| ./post.c:5071:16: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
| ./post.c:5071:16: note: use '&' for a bitwise operation
| ./post.c:5071:16: note: remove constant to silence this warning

Dennis

--- a/src/post.c
+++ b/src/post.c
@@ -5068,7 +5068,7 @@ checknadd_headers(
 		}
 #endif /* HAVE_SYS_UTSNAME_H && HAVE_UNAME */
 #ifdef SYSTEM_NAME
-		if (!*suffix && strlen(SYSTEM_NAME))
+		if (!*suffix && strlen(SYSTEM_NAME) > 0)
 				snprintf(suffix, sizeof(suffix), "(%s)", SYSTEM_NAME);
 #endif /* SYSTEM_NAME */
 




More information about the tin-dev mailing list