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 AE81442A4E; Wed, 3 May 2023 12:24:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A2014114B; Wed, 3 May 2023 12:24:04 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2056.outbound.protection.outlook.com [40.107.100.56]) by mails.dpdk.org (Postfix) with ESMTP id 55E3141144 for ; Wed, 3 May 2023 12:24:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qo3+q549UpchWpBB17DPtYZNol+tlTxcNcRPiSk6wZsyN/REhYE/AVq0FD+YRc0y3nT+qDeNYczv3PJLGDpjv/sO/qo0gGNLLgQqN3lMC5elJptL0Z6koRU0kfI6p9dh7tMMjs3HNqBHvXsKJrMEDV7FinCg2Mk2x/mFw3J97TcaET7BZxr9QSVtDHwIl6hbLK2Ga/0udpyxdqTw2oO7GjUoQs5aUxZPrChvj39GTS+T1FbVDxNRLfWoU/IyFYEwbcig/Xo7oIgKRflrV/mSMrIMDZ8n0w/IGEYdHLWKbM68Wi/gW7KmXzAxRMKqmtZuvVNQyPZctJIO6ksi+NnL6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4Vacw+2pleEXi6+Vry9upI2LKs+nbFQrbniPsgFE/Zw=; b=HbJq7AuKITPsz8TRwCA7IP2RTxzkZziREi0F5ost8BsJQzkUYnFLQY1h/A1oC0aY83GvJXUM2s4iCdgPRGgNVVdeGh2+EbF7mkKix4tbSudPKnIxuOvaNkqM8iUVb57YUOPPvGdzS8lTaupZRnIhP+9+usf945GiTXoicRyaU1Y4lf9TktJc06XLuKOAbD0p1HyLzebIRAp1ElU45hYECsmURTPtOxUgYLrf4pE5GOAp1UxR4KL7S5bAYgMgUi+p0dOjAqVpC3Y4UKrg5gWYInJMVreA0AVZG3izZ5GAu46J+2vJT/tm8I/2zPv97qmDUhUQu+wVVgYYmSS48qp3Jg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4Vacw+2pleEXi6+Vry9upI2LKs+nbFQrbniPsgFE/Zw=; b=eXg4E8DdFoo3nJFLvOutDBb1bjwA8aSziMTtnREFBKNWXoG1mXkCTINTYZ2FNBgAAs+HbaXHzRjsqW9THXieeoENNdpxjNMYcZ7YlUa/lM7XuzV1cSfsgsLbqNN0vp0VbXGCWATXfEH62Ckw/7uGS70ztBvqV156Qz7SZ/esIcM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH0PR12MB8127.namprd12.prod.outlook.com (2603:10b6:510:292::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22; Wed, 3 May 2023 10:24:00 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc%5]) with mapi id 15.20.6363.022; Wed, 3 May 2023 10:24:00 +0000 Message-ID: <529ef8b3-ec0b-262d-1893-e82bf8016ca5@amd.com> Date: Wed, 3 May 2023 11:23:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: Bruce Richardson Cc: Thomas Monjalon , dev@dpdk.org, David Marchand References: <20230503095018.1710769-1-ferruh.yigit@amd.com> From: Ferruh Yigit Subject: Re: [PATCH v1] devtools: allow variable declaration inside for loop In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0484.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a8::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH0PR12MB8127:EE_ X-MS-Office365-Filtering-Correlation-Id: 2734b2fc-a3ac-488e-f42f-08db4bc082a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u6rA+ZUmK6Tpe2X3qb0UuCyTfBn2c6xWehYwhmGkMXMrcz1nV4+sNrbXHKtQpHzTvuNMfqkf1/sDsTMmB+T30wQ7EEus3ek8RCTrfyxYWqNTHqePhPB/Ujr1SqkQPALz4VKMU+oRoMZJWTkBa0+rzsXvPBjXcMU2xl9CSpT80QbpAy3BmUjqil9MxU0T9IoK+IC7UQIfOX4QNK41j5kpU+EH1xnaSv2Hr4fBh3Kw48pKhZOJtxW0K6QRU7ptzFV/YV9w+EbslU7RmhxHQiwsU3e2/VRrylTJ66RR8Urr3oeDUXVcUfAn2CUg9J1r/lYPrpGYqmJvxyQEnrgYaVnT0/J5GzP53O/pebBrJVNFOu9enOoXWzBF6M7vziVNIiNj0EDAqximqyjqGne5C65SwAvYiJyQyNaDA+wIsUaXd6Nxd4fCbCFJ+kFMvSYRVpCzy69mDHnnqhwFFYublCyNv52ozKlxDpfzO9zxQWBOYLB8P0LSq+Ubi90VoZzMvmu3xNDilhqU9BSdf2pS6NwwSQ7Ir3QNpeWKQa2Nm2clSfBko7VK3CfzMP81cPQfFbtnkbCwKY8na6l5PS/t1ok+S5ZstbaV9QVx/+9Eg0+0NM4GRfeH4AjiQ39GFLW4N4M+bKHYHo99Xis6P4nssFMsEpFZ6r3TRua+qawfzLkwwIFzg8LITeenFqUzLSxIdAwS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(366004)(396003)(376002)(346002)(39860400002)(451199021)(478600001)(6666004)(316002)(66946007)(6916009)(4326008)(66556008)(66476007)(41300700001)(54906003)(38100700002)(6486002)(2616005)(83380400001)(966005)(6512007)(6506007)(26005)(186003)(31686004)(53546011)(86362001)(31696002)(36756003)(2906002)(44832011)(8936002)(8676002)(5660300002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SjR4VzZoa25iS1Q1SFBUUHBNam8xdTdIZ04yTEhIVlZKRUZCVWxJbGdTQWxy?= =?utf-8?B?eHhQckRRMHY4alZ6ZTg2M2h4K2ZNN2N4cGZSTXBwZ0gzbDhpVzRnUnp1aUpm?= =?utf-8?B?K2Y1LzJrSzV0bGZrMi9YNXJmeGR2QlFQVHY1Ny8wZ3MzdWxjcjlIelJvaVBZ?= =?utf-8?B?akRidXREeG1Od0t4NEJnaWg3SkU4NFBLK2JCc1hnSU53eDFFQ3dvYTVkeWUw?= =?utf-8?B?TGo3VEFnYXVnSlE1eUhYa2xQeVVOZE9RcUEybi9tb2xQVFdZNGdTcVE5UHRW?= =?utf-8?B?aEVkZkFDakduTDBpcXpRVUR1cTRKWGVIYUFBdCszN3Qwd0R2QjQyREdKTUZ3?= =?utf-8?B?L3IvZDJB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ange-CrossTenant-Network-Message-Id: 2734b2fc-a3ac-488e-f42f-08db4bc082a6 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2023 10:24:00.2932 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DFMrmby/Rxfy/nwg364+VkM4CGOQrkjVGqehVkiFUV3buZpT/qn7HDiuomjdzJJu X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8127 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 5/3/2023 11:02 AM, Bruce Richardson wrote: > On Wed, May 03, 2023 at 10:50:18AM +0100, Ferruh Yigit wrote: >> Declaring variable inside for loop is not supported via C89 and it was >> checked in checkpatch.sh via commit [1]. But as DPDK supported C >> standard is becoming C99 [2], declaring variable inside loop can be >> allowed. >> >> [1] Commit 43e73483a4b8 ("devtools: forbid variable declaration inside >> for") >> >> [2] https://dpdk.org/patch/121912 >> >> Signed-off-by: Ferruh Yigit --- Cc: Bruce >> Richardson Cc: David Marchand >> --- devtools/checkpatches.sh | 8 -------- 1 >> file changed, 8 deletions(-) >> > > Definite +1 from me for allowing this. However, is the plan still to move > to C99 in this release. I thought we were just going to jump to C11 in > 23.11 release? However, I can't see any compilers refusing this if we do > relax things a bit now. I will update the commit log for target as C99/C11 . > > I was thinking that our coding standards doc might need an update for this, > but I don't see the restriction on not doing this documented there, so it > seems no doc change is necessary. > Commit 43e73483a4b8 refers to following document: http://doc.dpdk.org/guides/contributing/coding_style.html#local-variables Which has: "Variables should be declared at the start of a block of code rather than in the middle." Although it is comparing between declaring start of a block and middle of the code, maybe we can update the document to explicitly state that declaring variable inside for loop is allowed to prevent confusion. Let me send a new version with documentation update.