From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2 1/3] json_print: fix Gcc-17 warnings
Date: Sun, 23 Aug 2026 16:51:31 -0700 [thread overview]
Message-ID: <20260823235220.79790-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20260823235220.79790-1-stephen@networkplumber.org>
Lastest version of Gcc and Clang warn about value of 2 in
logical operator. Example:
warning: use of logical ‘&&’ with constant operand ‘2’ [-Wconstant-logical-operand]
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
include/json_print.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/json_print.h b/include/json_print.h
index 6a458189..79d8d4ff 100644
--- a/include/json_print.h
+++ b/include/json_print.h
@@ -15,8 +15,8 @@
#include "json_writer.h"
#include "color.h"
-#define _IS_JSON_CONTEXT(type) (is_json_context() && (type & PRINT_JSON || type & PRINT_ANY))
-#define _IS_FP_CONTEXT(type) (!is_json_context() && (type & PRINT_FP || type & PRINT_ANY))
+#define _IS_JSON_CONTEXT(type) (is_json_context() && !!((type) & (PRINT_JSON | PRINT_ANY)))
+#define _IS_FP_CONTEXT(type) (!is_json_context() && !!((type) & (PRINT_FP | PRINT_ANY)))
json_writer_t *get_json_writer(void);
--
2.53.0
next prev parent reply other threads:[~2026-08-23 23:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 23:51 [PATCH iproute2 0/3] compiler warning fixes Stephen Hemminger
2026-08-23 23:51 ` Stephen Hemminger [this message]
2026-08-23 23:51 ` [PATCH iproute2 2/3] lib: fix warning from ll_addr_a2n Stephen Hemminger
2026-08-23 23:51 ` [PATCH iproute2 3/3] tc/f_u32: fix const strchr() warning Stephen Hemminger
2026-08-25 4:10 ` [PATCH iproute2 0/3] compiler warning fixes patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260823235220.79790-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.