From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF9EB45A81; Fri, 4 Oct 2024 09:26:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83DCA4027F; Fri, 4 Oct 2024 09:26:37 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 49D3340268 for ; Fri, 4 Oct 2024 09:26:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 62CA459 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1728026794; bh=x79RQit/U0ovh1fQ3Kje5UsS3T7OPe/mN0hHPAahIHo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mk/h+ED9qRklJTR/alU3QV0Kzf7c4zUonNjlfQgHd/unF+f0TugAIWl3oTH4ZeuCn oB0yVfrTWW5L2lVh8+C8VjbhBKwguLOeySy1MnhGezE9ieN5GrTzKlBqTZFDwvaA5k bCW8ebuO2hmK61jjxRfbck9vP7kQWnkEblmmqaDw= Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 62CA459; Fri, 4 Oct 2024 10:26:34 +0300 (MSK) Message-ID: <42a126ab-6162-4f9e-b547-4e9a36e723b2@oktetlabs.ru> Date: Fri, 4 Oct 2024 10:26:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ethdev: convert string initialization To: Ferruh Yigit , Thomas Monjalon , Ori Kam , Aman Singh , Konstantin Ananyev , Reshma Pattan , Stephen Hemminger , Akhil Goyal , Anoob Joseph , Potnuri Bharat Teja , Hemant Agrawal , Sachin Saxena , Matan Azrad , Viacheslav Ovsiienko , Dariusz Sosnowski , Bing Zhao , Suanming Mou , Chaoyong He Cc: dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= , Bruce Richardson References: <20240801092722.3732917-1-ferruh.yigit@amd.com> <20241004041335.2916435-1-ferruh.yigit@amd.com> Content-Language: en-US From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20241004041335.2916435-1-ferruh.yigit@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 10/4/24 07:13, Ferruh Yigit wrote: > gcc 15 experimental [1], with -Wextra flag, gives warning in variable > initialization as string [2]. > > The warning has a point when initialized variable is intended to use as > string, since assignment is missing the required null terminator for > this case. But warning is useless for our usecase. > > In this patch only updated a few instance to show the issue, there are > many instances to fix, if we prefer to go this way. > Other option is to disable warning but it can be useful for actual > string usecases, so I prefer to keep it. > > Converted string initialization to array initialization. > > [1] > gcc (GCC) 15.0.0 20241003 (experimental) > > [2] > ../lib/ethdev/rte_flow.h:906:36: > error: initializer-string for array of ‘unsigned char’ is too long > [-Werror=unterminated-string-initialization] > 906 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff", > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > ../lib/ethdev/rte_flow.h:907:36: > error: initializer-string for array of ‘unsigned char’ is too long > [-Werror=unterminated-string-initialization] > 907 | .hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff", > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > > ../lib/ethdev/rte_flow.h:1009:25: > error: initializer-string for array of ‘unsigned char’ is too long > [-Werror=unterminated-string-initialization] > 1009 | "\xff\xff\xff\xff\xff\xff\xff\xff" > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ../lib/ethdev/rte_flow.h:1012:25: > error: initializer-string for array of ‘unsigned char’ is too long > [-Werror=unterminated-string-initialization] > 1012 | "\xff\xff\xff\xff\xff\xff\xff\xff" > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ../lib/ethdev/rte_flow.h:1135:20: > error: initializer-string for array of ‘unsigned char’ is too long > [-Werror=unterminated-string-initialization] > 1135 | .hdr.vni = "\xff\xff\xff", > | ^~~~~~~~~~~~~~ > > Signed-off-by: Ferruh Yigit > Acked-by: Morten Brørup > Acked-by: Bruce Richardson Acked-by: Andrew Rybchenko