From patchwork Sun Feb 19 15:20:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1744700 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=auWIryqu; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=onUlGYvI; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PKTpq6Bpqz240n for ; Mon, 20 Feb 2023 02:23:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GY4wn8tbesWtj6Q/qhjc+faEcFImq40SPZwAL1rjPFQ=; b=auWIryquqDTkEt pxQO3xf2BIAnIz7mFmYA8XTEq5Fm1xutz5jRu3L7Uagu3qv0SPSzwPtRzJiGGthMO8W9hG/pLQIC9 ZKbghrAkIwact2So8Fbw870XPf5xP5iYOBaw6woVKBre1vn+qJGoJW5L9R08II7YMn/bTTLlX0dF9 Z39CcRNylKRUiSroPcx3NzG73ik98mNaXj2syPtEvOZh7jJvWWD6dE2EiQ56XgfCeyVKowa/Tb0eF RpTjXnXratv+cgq7ggucBGtRY6pWB41WxjSQKIDjxRnRTsfx8Db6407PyG7d8AgMGS26hkAH4b0Zw 8xoCNe86mwWu/mOehlgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlV2-001maa-OL; Sun, 19 Feb 2023 15:21:13 +0000 Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlUm-001mX9-0W for openwrt-devel@lists.openwrt.org; Sun, 19 Feb 2023 15:20:57 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4PKTlK2TZHz9sRK; Sun, 19 Feb 2023 16:20:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1676820045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nb8ls3UAFp0ZxdXn/ww+yAhXxkRCGNsPTJc+Rxl7MQ0=; b=onUlGYvIeJ5wPGgkmlJibmk4BnEjjNclQeY6z7WZh03racbzsBYf/ZROmgQh9U97LNt4NN fnzg6diwF99xI6iUGrRahptMTe98EqVmDWBdpB/Nzdz3SPCMyUr3cMpYtq7+yIhO04sC8H TpkxVNOJcfP+YLbm8FZINfMi/1/ZztuV2Ng/AOHpV+hUmhk7eYOWVe0q3+eHo1h7IlvEIj 5q/Fn9aAAm6p1htS1CA5GVnvMpFLCjD9W3iMsaCbU37GW31VEIiLKpXGRF5JPvEmtQ7tLO 0W/jPZs5c3I4oz5Pe2hSAwb5M+r4iEI0tw0ICP87BsWaE0oeLjkMfsmensWMAw== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH netifd 1/5] netifd: bridge: Fix format string position Date: Sun, 19 Feb 2023 16:20:23 +0100 Message-Id: <20230219152027.3417324-2-hauke@hauke-m.de> In-Reply-To: <20230219152027.3417324-1-hauke@hauke-m.de> References: <20230219152027.3417324-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PKTlK2TZHz9sRK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230219_072056_270274_EADA3707 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This fixes the following compile error: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] blobmsg_printf() has the following signature: int blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, ...) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:67c:2050:0:465:0:0:101 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This fixes the following compile error: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] blobmsg_printf() has the following signature: int blobmsg_printf(struct blob_buf *buf, const char *name, const char *format, ...) Signed-off-by: Hauke Mehrtens --- bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge.c b/bridge.c index 7e61b9d..ae305e8 100644 --- a/bridge.c +++ b/bridge.c @@ -934,7 +934,7 @@ bridge_dump_port(struct blob_buf *b, struct bridge_vlan_port *port) bool tagged = !(port->flags & BRVLAN_F_UNTAGGED); bool pvid = (port->flags & BRVLAN_F_PVID); - blobmsg_printf(b, "%s%s%s%s\n", port->ifname, + blobmsg_printf(b, NULL, "%s%s%s%s\n", port->ifname, tagged || pvid ? ":" : "", tagged ? "t" : "", pvid ? "*" : ""); From patchwork Sun Feb 19 15:20:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1744705 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0DNooz4k; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=1f5Ac/Mp; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PKTq12s0Fz23j7 for ; Mon, 20 Feb 2023 02:23:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3ltr9q1xRvCGnP7hcPheykSwCErxN5ordpLUtPGU4C8=; b=0DNooz4kdYMjpg 0JZMebJkmfWKx3sj+MRfdqNQVAOw9xA95RtEr9YNdK+ftX/8j0SZ2guPUFLp/prR9KyC4EFpLmmV2 1AGF+DAEdIBXeHQHxc/sty9kqA+reOGFyrEWbcrlTvEvl1vn2HNbcciGbHWVMXfNey94UB8A21a8Z UFb58/w2tuHnTaK4SfGxX6Vy8ek3jQYhFqJV8+Y1Bo0CaoeiTh+zVyjOAsSIuwfeidLdvtWF9KZNJ j8ZknaCKxvGEABplwj6TwHq3ETAawnSzH+sM8gSLSK99wJhUeBOp/6CfbNlwfTLtEqYLzVyRbMWST Clqo+1vTaet/851HiOBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlW6-001mmZ-4w; Sun, 19 Feb 2023 15:22:18 +0000 Received: from mout-p-102.mailbox.org ([80.241.56.152]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlUm-001mX7-Pv for openwrt-devel@lists.openwrt.org; Sun, 19 Feb 2023 15:20:59 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4PKTlK672kz9sTq; Sun, 19 Feb 2023 16:20:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1676820045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PA3ePpPvfRAm8OxzaW3UYnblJf4lvOPXBHS9FfxNAJ8=; b=1f5Ac/MpKwwnmd1lSO7zN/dZQj8PQZ0IsL6eiN9uMjHh0SVFKGrsXsHU5Pf1smeE/0bBBD ylkbDkMiWFOwRMbBwejn0K1XJy6RsIzpw8PTcD+lSJKwsBnF2n5X9JpQRYwLG1p32iezuI TIkeLVeSGUF0lA3mAqOGeQyYSGUj3XQVQQ+A1gQoLd8XVxQVGDgGCf8JMIfaxbmvVDl+Aw JK4vstHEK2pWoHeSsJIHD9U+I1+iZzi15ecMYSDbNbccylYsaeMjepH08Sc5mGA0fXkF+d +CpgqYfSjJzgHXTT6RTdZkEeRxsJQ4i0bTS5f5R5FwmZHxmTRZWLqhMWGl5vcA== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH netifd 2/5] netifd: Fix multiple -Wsign-compare warnings Date: Sun, 19 Feb 2023 16:20:24 +0100 Message-Id: <20230219152027.3417324-3-hauke@hauke-m.de> In-Reply-To: <20230219152027.3417324-1-hauke@hauke-m.de> References: <20230219152027.3417324-1-hauke@hauke-m.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230219_072057_062619_C05640CE X-CRM114-Status: GOOD ( 19.91 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This fixes warnings like this: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Mostly this was an int compared to a size_t returned by ARRAY_SIZE(). The easiest fix is to count on the size_t type. Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This fixes warnings like this: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Mostly this was an int compared to a size_t returned by ARRAY_SIZE(). The easiest fix is to count on the size_t type. The ifindex is sometimes an unsigned int and sometimes a signed int in the kernel interfaces. I think it normally fits into an unsigned 16 bit value, so this should be fine. Do the one comparison where the compiler complains as a long. Casting the result of sizeof() to int should be safe. These values are never out of range of int. Signed-off-by: Hauke Mehrtens --- bonding.c | 2 +- handler.c | 5 +++-- interface-ip.c | 2 +- main.c | 4 ++-- system-linux.c | 21 ++++++++++++--------- ubus.c | 4 ++-- vlan.c | 4 ++-- wireless.c | 2 +- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/bonding.c b/bonding.c index 457fe51..f4005de 100644 --- a/bonding.c +++ b/bonding.c @@ -396,7 +396,7 @@ bonding_apply_settings(struct bonding_device *bdev, struct blob_attr **tb) if ((cur = tb[BOND_ATTR_POLICY]) != NULL) { const char *policy = blobmsg_get_string(cur); - int i; + size_t i; for (i = 0; i < ARRAY_SIZE(bonding_policy_str); i++) { if (strcmp(policy, bonding_policy_str[i]) != 0) diff --git a/handler.c b/handler.c index 04bdbee..78fc9a0 100644 --- a/handler.c +++ b/handler.c @@ -229,7 +229,8 @@ netifd_parse_extdev_handler(const char *path_to_file, create_extdev_handler_cb c void netifd_init_script_handlers(int dir_fd, script_dump_cb cb) { glob_t g; - int i, prev_fd; + int prev_fd; + size_t i; prev_fd = netifd_dir_push(dir_fd); if (glob("./*.sh", 0, NULL, &g)) { @@ -252,7 +253,7 @@ netifd_init_extdev_handlers(int dir_fd, create_extdev_handler_cb cb) prev_fd = netifd_dir_push(dir_fd); glob("*.json", 0, NULL, &g); - for (int i = 0; i < g.gl_pathc; i++) + for (size_t i = 0; i < g.gl_pathc; i++) netifd_parse_extdev_handler(g.gl_pathv[i], cb); netifd_dir_pop(prev_fd); } diff --git a/interface-ip.c b/interface-ip.c index ab4a5cf..7359db2 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -99,7 +99,7 @@ static struct uloop_timeout valid_until_timeout; static void clear_if_addr(union if_addr *a, int mask) { - int m_bytes = (mask + 7) / 8; + size_t m_bytes = (mask + 7) / 8; uint8_t m_clear = (1 << (m_bytes * 8 - mask)) - 1; uint8_t *p = (uint8_t *) a; diff --git a/main.c b/main.c index 4c1c855..874dc8b 100644 --- a/main.c +++ b/main.c @@ -303,8 +303,8 @@ int main(int argc, char **argv) break; case 'l': log_level = atoi(optarg); - if (log_level >= ARRAY_SIZE(log_class)) - log_level = ARRAY_SIZE(log_class) - 1; + if (log_level >= (int)ARRAY_SIZE(log_class)) + log_level = (int)ARRAY_SIZE(log_class) - 1; break; #ifndef DUMMY_MODE case 'S': diff --git a/system-linux.c b/system-linux.c index 45a9efb..d13a561 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1154,7 +1154,7 @@ static bool check_ifaddr(struct nlmsghdr *hdr, int ifindex) { struct ifaddrmsg *ifa = NLMSG_DATA(hdr); - return ifa->ifa_index == ifindex; + return (long)ifa->ifa_index == ifindex; } static bool check_route(struct nlmsghdr *hdr, int ifindex) @@ -1438,7 +1438,8 @@ int system_macvlan_add(struct device *macvlan, struct device *dev, struct macvla { struct nl_msg *msg; struct nlattr *linkinfo, *data; - int i, rv; + size_t i; + int rv; static const struct { const char *name; enum macvlan_mode val; @@ -1700,7 +1701,7 @@ system_set_ethtool_settings(struct device *dev, struct device_settings *s) .ifr_data = (caddr_t)&ecmd, }; static const struct { - int speed; + unsigned int speed; uint8_t bit_half; uint8_t bit_full; } speed_mask[] = { @@ -1709,7 +1710,7 @@ system_set_ethtool_settings(struct device *dev, struct device_settings *s) { 1000, ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ETHTOOL_LINK_MODE_1000baseT_Full_BIT }, }; uint32_t adv; - int i; + size_t i; strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name) - 1); @@ -2355,7 +2356,7 @@ static const struct { static void system_add_link_modes(struct blob_buf *b, __u32 mask) { - int i; + size_t i; for (i = 0; i < ARRAY_SIZE(ethtool_link_modes); i++) { if (mask & ethtool_link_modes[i].mask) blobmsg_add_string(b, NULL, ethtool_link_modes[i].name); @@ -2373,7 +2374,7 @@ system_if_force_external(const char *ifname) static const char * system_netdevtype_name(unsigned short dev_type) { - unsigned int i; + size_t i; for (i = 0; i < ARRAY_SIZE(netdev_types); i++) { if (netdev_types[i].id == dev_type) @@ -2457,7 +2458,8 @@ ethtool_feature_index(const char *ifname, const char *keyname) { struct ethtool_gstrings *feature_names; struct ifreq ifr = { 0 }; - int32_t n_features, i; + int32_t n_features; + uint32_t i; n_features = ethtool_feature_count(ifname); @@ -2592,7 +2594,7 @@ system_if_dump_stats(struct device *dev, struct blob_buf *b) "rx_fifo_errors", "tx_carrier_errors", }; int stats_dir; - int i; + size_t i; uint64_t val = 0; stats_dir = open(dev_sysfs_path(dev->ifname, "statistics"), O_DIRECTORY); @@ -2838,7 +2840,8 @@ int system_del_route(struct device *dev, struct device_route *route) int system_flush_routes(void) { const char *names[] = { "ipv4", "ipv6" }; - int fd, i; + size_t i; + int fd; for (i = 0; i < ARRAY_SIZE(names); i++) { snprintf(dev_buf, sizeof(dev_buf), "%s/sys/net/%s/route/flush", proc_path, names[i]); diff --git a/ubus.c b/ubus.c index 7f4821d..4d05786 100644 --- a/ubus.c +++ b/ubus.c @@ -1132,7 +1132,7 @@ netifd_handle_iface(struct ubus_context *ctx, struct ubus_object *obj, { struct interface *iface; struct blob_attr *tb; - int i; + size_t i; blobmsg_parse(&iface_policy, 1, &tb, blob_data(msg), blob_len(msg)); if (!tb) @@ -1158,7 +1158,7 @@ netifd_handle_iface(struct ubus_context *ctx, struct ubus_object *obj, static void netifd_add_iface_object(void) { struct ubus_method *methods; - int i; + size_t i; methods = calloc(1, sizeof(iface_object_methods)); if (!methods) diff --git a/vlan.c b/vlan.c index 3d444a9..4d32b60 100644 --- a/vlan.c +++ b/vlan.c @@ -143,7 +143,7 @@ static void vlan_dev_cb(struct device_user *dep, enum device_event ev) vlan_hotplug_check(vldev, dep->dev); vldev->dev.hidden = dep->dev->hidden; if (snprintf(name, sizeof(name), "%s.%d", dep->dev->ifname, - vldev->id) >= sizeof(name) - 1 || + vldev->id) >= (int)sizeof(name) - 1 || device_set_ifname(&vldev->dev, name)) free_vlan_if(&vldev->dev); break; @@ -203,7 +203,7 @@ static struct device *get_vlan_device(struct device *dev, char *id_str, bool cre if (!create) return NULL; - if (snprintf(name, sizeof(name), "%s.%d", dev->ifname, id) >= sizeof(name) - 1) + if (snprintf(name, sizeof(name), "%s.%d", dev->ifname, id) >= (int)sizeof(name) - 1) return NULL; D(DEVICE, "Create vlan device '%s'\n", name); diff --git a/wireless.c b/wireless.c index 705d6dd..1f54bfb 100644 --- a/wireless.c +++ b/wireless.c @@ -1542,7 +1542,7 @@ void wireless_device_hotplug_event(const char *name, bool add) struct wireless_interface *vif; struct wireless_device *wdev; const char *s; - int len; + size_t len; s = strstr(name, ".sta"); if (s) { From patchwork Sun Feb 19 15:20:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1744702 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0Haqutmw; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=k4SOZRB7; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PKTpv1BKSz23j7 for ; Mon, 20 Feb 2023 02:23:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=s5aEMRf3m2vm9pd584vzv13vlm4+EMc1t7EQDzuEtzQ=; b=0Haqutmwbo2jUJ zzN9KP6YImDrVYqyHoCVu8YSbeYXfDaSKUB0fSwkJ9YwIZrPhFM62zwULf3Nfbpl4whlbnvoBjGAK vr6ySxrA2hlDpPPoSrKyf1juepzYrQVIrZjNtY4ex7Gq9AqCvsuKG/ZFK2W8JaWczsVAMQRri67iD vB7xn6IS1AFMva9gj6J9NHgAQsSeO6ZNObVGgHyz7ajH5czdLhdU9j7auLCcL37p79CQQt1qPXMY5 BmaugGkjkQU1I9aRGsEslJQK+ZFOE1tDj0hzxKp0gRBvxKnCywfEvm8k7Ke5yrH09twtuT0tefaGT ZFr6IkiKJ8sojsXKn2JA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlUp-001mZ8-Ux; Sun, 19 Feb 2023 15:21:00 +0000 Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlUl-001mX6-W3 for openwrt-devel@lists.openwrt.org; Sun, 19 Feb 2023 15:20:57 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4PKTlL1TfRz9sV0; Sun, 19 Feb 2023 16:20:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1676820046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ur1O5cuLbQZQkc2dw39aVGud3n6ZSZDoiWFmo7s+6D4=; b=k4SOZRB76PmwwV7bl7OnSAg8lX+MdS0pcfhwNH592++tFrQcu1PO+FrhP5kwSPlAgWiZqM JUCKN4frYWb6kdLLm9frltPeCoiWcCqWkSSUePjHFk7WFhjx+IZwJoRuabdRliEZZTM4B1 EEt6PQmSCKbmtsz2l0tl/YLbd1aIkOC0G15DjxKavdLweslxBr+a9Y+umQGWdTxH/6Ydsp cgWWnCVg1rK4b++ky54YD+3q6zJGfUEAEz0dTz63hY+vzE8QNW0DwrSuHwB04HY9Dd8ka/ F0GYSxNaN/0xEYIOI7FbrGAVV7Ui+6J9rKaD0HZQuu6dD1l9epJyM9EVLgMZ0g== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH netifd 3/5] netifd: Do not return values in void function Date: Sun, 19 Feb 2023 16:20:25 +0100 Message-Id: <20230219152027.3417324-4-hauke@hauke-m.de> In-Reply-To: <20230219152027.3417324-1-hauke@hauke-m.de> References: <20230219152027.3417324-1-hauke@hauke-m.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230219_072056_248344_133928B9 X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: These two functions return void, do not try to return a parameter. Signed-off-by: Hauke Mehrtens --- interface-event.c | 6 ++++-- main.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:67c:2050:0:465:0:0:102 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org These two functions return void, do not try to return a parameter. Signed-off-by: Hauke Mehrtens --- interface-event.c | 6 ++++-- main.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/interface-event.c b/interface-event.c index a40f6dc..b03bfbc 100644 --- a/interface-event.c +++ b/interface-event.c @@ -49,8 +49,10 @@ run_cmd(const char *ifname, const char *device, enum interface_event event, int pid; pid = fork(); - if (pid < 0) - return task_complete(NULL, -1); + if (pid < 0) { + task_complete(NULL, -1); + return; + } if (pid > 0) { task.pid = pid; diff --git a/main.c b/main.c index 874dc8b..e5260b5 100644 --- a/main.c +++ b/main.c @@ -129,7 +129,8 @@ netifd_process_cb(struct uloop_process *proc, int ret) np = container_of(proc, struct netifd_process, uloop); netifd_delete_process(np); - return np->cb(np, ret); + np->cb(np, ret); + return; } int From patchwork Sun Feb 19 15:20:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1744704 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=odLufMQD; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=af3PPvzu; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PKTpv5XyKz23j7 for ; Mon, 20 Feb 2023 02:23:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LHycqZkn1vgrVNT9adhnaYGYeODNH1yjTcSI0izkzLg=; b=odLufMQDLQarbh P6JhM2XbNp9bLMydIhfaKtpuRPaPlJScVuqBUbXns+cj3AMZNAYopK97Iu1v8rmpP+Ey97RPEstuU dyUO+JOMD1MgeGOYg6+pmHt5d4WXxoPkOpYvpkC8wpHAjM6MM9jsmzV4HczXC3ugXArH94cgHtikl XHFHwpGkfOPHeSb2EuyVal1sRB0GOELNvGQxfB52HJJRoNx7nOSsTGj9epGqTHmXZnznBVy5uXmxZ ++OFK9nNPNqLo1pYgGvQ5weCiQTS9cdgshrGBoqFIzCFE8JB7xh5bH92PxrqcpM4VlF9661jIkJvY u1zw+d2ipkQ0BWPYYcMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlVm-001mhL-9U; Sun, 19 Feb 2023 15:21:58 +0000 Received: from mout-p-101.mailbox.org ([80.241.56.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlUm-001mXA-Qn for openwrt-devel@lists.openwrt.org; Sun, 19 Feb 2023 15:20:58 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4PKTlL40GDz9sVy; Sun, 19 Feb 2023 16:20:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1676820046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oNZ+A227TIxMqSflNSKjZU9XEXohe8tf40cbJH5ZtWU=; b=af3PPvzu9wdTa01PjxvJNirUyof/dZM5SF2RQmsD+SRkRiSCSKa6n+YRDTgY3iX0TtTXh/ 0RrOZiaGUqLNs43ngcYGz/tkSkTQ7l0ck0lJdLLleliybTI+dZp+efP1flAwBOUBPNggfb R/kCvM+d0ZWhBtHSh/+MmT07zL8yMj/OxO4QpNcG6ggvAl1EMUyViIkJxjTGkhJ9Dw+0Dg y841mUqg9emKNIsQb4QwsSQ944AlQAwzm4Z0V2c9gs6uXfcYoOP7Ot4DOAueijhDiviJSC Dse4Wz4826BpKLhLqzZkhfIUrCfRFsdPeTiHj8b7jrUIL1SzYT82EmbnZEAq9A== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH netifd 4/5] netifd: Explicitly zero initialize variables Date: Sun, 19 Feb 2023 16:20:26 +0100 Message-Id: <20230219152027.3417324-5-hauke@hauke-m.de> In-Reply-To: <20230219152027.3417324-1-hauke@hauke-m.de> References: <20230219152027.3417324-1-hauke@hauke-m.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230219_072057_061367_1B51656B X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The -pedantic option was complaining about the old initialization and prefers if it is explicitly initialized to zero. Signed-off-by: Hauke Mehrtens --- proto.c | 2 +- system-linux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.151 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The -pedantic option was complaining about the old initialization and prefers if it is explicitly initialized to zero. Signed-off-by: Hauke Mehrtens --- proto.c | 2 +- system-linux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto.c b/proto.c index 01473f2..48dd213 100644 --- a/proto.c +++ b/proto.c @@ -416,7 +416,7 @@ proto_apply_static_ip_settings(struct interface *iface, struct blob_attr *attr) unsigned int netmask = 32; bool ip6deprecated; int n_v4 = 0, n_v6 = 0; - struct in_addr bcast = {}, ptp = {}; + struct in_addr bcast = {0,}, ptp = {0,}; blobmsg_parse(proto_ip_attributes, __OPT_MAX, tb, blob_data(attr), blob_len(attr)); diff --git a/system-linux.c b/system-linux.c index d13a561..e4041fb 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1529,7 +1529,7 @@ int system_netns_set(int netns_fd) int system_veth_add(struct device *veth, struct veth_config *cfg) { struct nl_msg *msg; - struct ifinfomsg empty_iim = {}; + struct ifinfomsg empty_iim = {0,}; struct nlattr *linkinfo, *data, *veth_info; int rv; From patchwork Sun Feb 19 15:20:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1744701 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=o+hTqUOY; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=XQG+rcIL; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PKTpq62SLz23j7 for ; Mon, 20 Feb 2023 02:23:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k8qsf5DLmOL95i6wLEdxAGfPMZlg8YSyAFFI8U7mY6Q=; b=o+hTqUOY2pEqD4 26eSYOfKwGm3oMwChq2HL4eFhkSc72okkEmxLOdi5TdMWuSNtbhc2d6RixdklrcGnLhqx74g7a5AW 3yJeAU4THglpt7em2Al+CGRPHSwfDlhhWRKLnD6iK0MafRLclMBwN5BLxsHLaiQpu/oHnkTvnqP0M pnoD/hPe13/xx59ZJ8Ug4mBwi0cHVEGpV/AN/1bJNXkbXWJ0FMA7IpcYZ7I7f1iobH32my37WFPA9 WXIoM3ivf5eTtBgEtmJFmKeOR7zXsD/FAkdnBD5zbDB6VB/Vq5z4of1kuv8J/mkrioScqXOwFdbPI kLbvsuMJjlksEMuSHmlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlVX-001mdl-O7; Sun, 19 Feb 2023 15:21:43 +0000 Received: from mout-p-202.mailbox.org ([80.241.56.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTlUm-001mX8-SQ for openwrt-devel@lists.openwrt.org; Sun, 19 Feb 2023 15:20:58 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4PKTlL6PkRz9sPy; Sun, 19 Feb 2023 16:20:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1676820046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i1KK0HsOA90Dx7ruk644w0+9d1oGAhmbfuwTvBjnk/M=; b=XQG+rcILWIiCt699PZNLKVbO9PJliEBfdg9F1FvET+Y6gxG6bzeE8LRrZfK0Z+CydMKPMV JxMHEs8juoi9UzMwXbRW+X5n8cB6cbhXkJw/7BRaEUM7PzKA1PemuMp0ZjroHvtZjMegiZ CYMPxviaAMGBWgRRCTh06mQptEPNV+1lP/eNC4q5mEcqohgg216gm4XQc3yALt7G40m/6M DDUFZxjvug0H+wdafr8Nqiacmox7cNLy5wKVfK73d5OEKYdSHoycjHqj8wPcu+wqQtAetZ 8ncw02A3Nw/hNPAL9qV6TDccBsYmgeZS88MC0Lk5Hj+KzaU0imekaPy5+8KEFw== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Cc: Hauke Mehrtens Subject: [PATCH netifd 5/5] netifd: Activate -Wextra compile warnings Date: Sun, 19 Feb 2023 16:20:27 +0100 Message-Id: <20230219152027.3417324-6-hauke@hauke-m.de> In-Reply-To: <20230219152027.3417324-1-hauke@hauke-m.de> References: <20230219152027.3417324-1-hauke@hauke-m.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230219_072057_217914_071D0F58 X-CRM114-Status: UNSURE ( 6.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This activates some more compile warnings. -pedantic is not yet activated, then we see too many errors which I do not know how to mitigate. Signed-off-by: Hauke Mehrtens --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This activates some more compile warnings. -pedantic is not yet activated, then we see too many errors which I do not know how to mitigate. Signed-off-by: Hauke Mehrtens --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3bf411..b87c300 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,11 @@ IF(NOT ${CMAKE_VERSION} LESS 3.0) check_c_compiler_flag(-Wimplicit-fallthrough HAS_IMPLICIT_FALLTHROUGH) ENDIF() -ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unknown-warning-option -Wno-format-truncation) +ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter) +IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6) + add_definitions(-Wextra -Werror=implicit-function-declaration) + add_definitions(-Wformat -Werror=format-security -Werror=format-nonliteral) +ENDIF() IF(HAS_IMPLICIT_FALLTHROUGH) ADD_DEFINITIONS(-Wimplicit-fallthrough)