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 5F318424C1; Mon, 10 Jun 2024 17:10:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB141402A9; Mon, 10 Jun 2024 17:10:04 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 445ED40294 for ; Mon, 10 Jun 2024 17:10:03 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 079CB2035F for ; Mon, 10 Jun 2024 17:10:03 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Coding Style for local variables Date: Mon, 10 Jun 2024 17:10:01 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F512@smartserver.smartshare.dk> X-MS-Has-Attach: X-MimeOLE: Produced By Microsoft Exchange V6.5 X-MS-TNEF-Correlator: Thread-Topic: Coding Style for local variables Thread-Index: Adq7SEPoIrinBLT+QHOLQL6ebOrFXA== From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: 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 The coding style guide says: "Variables should be declared at the start of a block of code rather = than in the middle. The exception to this is when the variable is const = in which case the declaration must be at the point of first = use/assignment. Declaring variable inside a for loop is OK." Since DPDK switched to C11, variables can be declared where they are = used, which reduces the risk of using effectively uninitialized = variables. "Effectively uninitialized" means initialized to 0 or NULL = where declared, to silence any compiler warnings about the use of = uninitialized variables. Can we please agree to remove the recommendation/requirement to declare = variables at the start of a block of code?