From patchwork Thu Oct 9 09:21:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 2147527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4cj4DT4hzBz1y1V for ; Thu, 9 Oct 2025 20:23:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D62B941012; Thu, 9 Oct 2025 09:23:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qZaquvxzNcPZ; Thu, 9 Oct 2025 09:23:19 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DC18B40F6A Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id DC18B40F6A; Thu, 9 Oct 2025 09:23:18 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C631FC060E; Thu, 9 Oct 2025 09:23:18 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0CE9EC060D for ; Thu, 9 Oct 2025 09:23:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CFADA611FA for ; Thu, 9 Oct 2025 09:23:02 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id m6mog-Quiw4b for ; Thu, 9 Oct 2025 09:23:01 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.128.66; helo=mail-wm1-f66.google.com; envelope-from=i.maximets.ovn@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 9A317611B2 Authentication-Results: smtp3.osuosl.org; dmarc=none (p=none dis=none) header.from=ovn.org DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9A317611B2 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by smtp3.osuosl.org (Postfix) with ESMTPS id 9A317611B2 for ; Thu, 9 Oct 2025 09:23:01 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id 5b1f17b1804b1-46e491a5b96so3760405e9.2 for ; Thu, 09 Oct 2025 02:23:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760001779; x=1760606579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iCfHejauwcFM7Mtwbxyg68Iopr8kT9rc72fqziOxDxA=; b=l5+YqbnNMGl7s3X+8snVhW+Px5xQgUFe/7KaXvWpIXGG0dtSY9lgzU6rj90XBzVuss Y//cWSrXh5Zl22/USnPKSpUNi4ahSpduKyxlws2PbEvie/1eq2MMwv3ciyuFLPdqDY/N t9ZrEriQ+UBQ7VgLflP/fOBZUwI6dTp0/2H9N7J9vRfftsQHD4bvwIRv+//QcxHb9TID oUZaxLHwMMxrHBA61N/ks2aIb4Yco1cr4WjkPR0BzGIFMEhLfC+PMsWqEL4cpNd38zez srSakpcT78KOQKGlXDhOXB9NJrD/GwOMQ/MseMysqyiF+9IKSXwwaLETE1atthxv4Z7s 8Gpw== X-Gm-Message-State: AOJu0Yy4kRXslZFcNd1VixhcJUezs2czNx8xSqdD6gwkv09cFhBFERmS AnJnTZfjaoXMFIip+HLuksiXIpg12UHcqD6I/mAKnNVv+W+PAKdTk7OylnXo9fRJ X-Gm-Gg: ASbGncuyfyTiPe3M3SLUwbrGtOFRjiHrFR918x48fb4X2Qy56yJgPIVH/tlsi3GNSFY hdtmba/HYXtdgHY5aVnHHUCFcVanNOMxb87vfYmxzGqClgSukgKFTCV1uz/edMUc8JIAKdf2Lwm 9Kr4Mur9aH2b7iNqIP9I86FI1mQBxlhw6YKv2GILSKBBqxSyzVic87vlLE/C4+ytGJaneAv5gBz h5ilzxvyvQg+KrTpO6iWlO0vO/eedVI3qSnKRtLgXpUnND/C2ci3ZQJXd0nUH9oBaz9K0FybhAh CXT9lE5P2jhjzyUVA8yhiLOkoUxNKzzEhsC8XySf+kKXRSzWkm7ByYYKkngBUGjqGELOqN7s/PB SXwDLwgbghYHaeGpQ501kUzW+5HWxbCAzS/iBze+eqd/T9K1+ZD6jqLikkz3DyUCFYSnGuM1kFL PF8OICrI1J50euGMs26LXvzw== X-Google-Smtp-Source: AGHT+IFd4oKsAoGYPpGqayJ2TSqLpcQiwpcda+7iVrS1tqCsn1ftyStfNC2X8yFBzMJLd8v8bUAccg== X-Received: by 2002:a05:600c:1395:b0:46e:1cc6:25f7 with SMTP id 5b1f17b1804b1-46fa9aa045dmr48397935e9.9.1760001779301; Thu, 09 Oct 2025 02:22:59 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-48-237.nat.epc.tmcz.cz. [37.48.48.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4255d8f0392sm34313629f8f.42.2025.10.09.02.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Oct 2025 02:22:58 -0700 (PDT) From: Ilya Maximets To: ovs-dev@openvswitch.org Cc: Ilya Maximets Date: Thu, 9 Oct 2025 11:21:25 +0200 Message-ID: <20251009092228.382349-6-i.maximets@ovn.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251009092228.382349-1-i.maximets@ovn.org> References: <20251009092228.382349-1-i.maximets@ovn.org> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH 5/6] test-psample: Fix missing field initializer warnings on older GCC. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" GCC 4.8 complains for some reason: tests/test-psample.c: In function 'run': tests/test-psample.c:217:12: error: missing initializer for field 'packet' of 'struct sample' [-Werror=missing-field-initializers] struct sample sample = {}; ^ While it is a little strange to complain, the {} initializer is a C++ thing and a GNU extension, so we should not be using it. It's only available in C23 standard. Also, the initialization is not even necessary here, all the fields will be initialized later with sample_clear(), as long as it covers all the fields (rate was missing). Fixes: 742de01a4a2e ("tests: Add test-psample testing utility.") Signed-off-by: Ilya Maximets Acked-by: Kevin Traynor Acked-by: Eelco Chaudron --- tests/test-psample.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test-psample.c b/tests/test-psample.c index 1494dcc8d..9eaa11b00 100644 --- a/tests/test-psample.c +++ b/tests/test-psample.c @@ -160,6 +160,7 @@ static inline void sample_clear(struct sample *sample) { sample->group_id = 0; + sample->rate = 0; sample->obs_domain_id = 0; sample->obs_point_id = 0; sample->has_cookie = false; @@ -214,7 +215,7 @@ parse_psample(struct ofpbuf *buf, struct sample *sample) static void run(struct nl_sock *sock) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 10); - struct sample sample = {}; + struct sample sample; int error; dp_packet_init(&sample.packet, 1500);