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 80D9A43A4E; Fri, 2 Feb 2024 10:41:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54729402DC; Fri, 2 Feb 2024 10:41:18 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 11EB74026E; Fri, 2 Feb 2024 10:41:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706866876; x=1738402876; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=ILZwhDRUY90kvUb8ZJdwREOUgoiIdyuurRMWWcYJfPk=; b=mntSiQpwRhZw76dHAkab9lVax4oaMl1FxZ02uWztYEAMBaZIGoXWEnE9 D0nW38ORGGp5j0GDvaW2kGehLc+WNVAnaF2si55XqN8fFJ4EDxqKUhos8 LPUALP65Exl9XIiMsdo8XihDUlX6Jcee3zweNfFzsGaWZFlHZkJBiOpG+ ouEmUV9kThcfqV9b2Z5Ek5qgkl0r/qLmswX7oZUTmsyCoJx6bEi6ot3Yd wMmKPVwbgYhe/JC3nDnc7WTxZdzb4pHIoktL9AyRCcHRFYix2p3s6wun4 to44KRbJkwz4tqldkOHonMf8rcuhCySgn/1hDxyKc4IuFqf0/VWOgfbN7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="25575956" X-IronPort-AV: E=Sophos;i="6.05,237,1701158400"; d="scan'208";a="25575956" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 01:41:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,237,1701158400"; d="scan'208";a="100925" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 02 Feb 2024 01:41:15 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 2 Feb 2024 01:41:14 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 2 Feb 2024 01:41:14 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 2 Feb 2024 01:41:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lj7klzaTYBSZasJoPgAb1FasRmxrAd4xnmGKS8hXSHYJ28ST13+fdgOwIusYEH3DjhOjoMzsurYAY1S+1gWPm7A96EfaomGek4ReWSOXiq33Up17r1Hmb1n93M7RHG6QznRg/9RqKj2jFIwKYD4zGtaVRBcO/gbSScFirpzk9PbhaF31kE0zSP78WajoJMqsiLD3btgQvvC1Tlju4fzDFTrNXie5rNrzE8OKjDBCXjYqpy7iRe2rW584RO0fHYCIEhwTfCHA/bCcN/JSVw+pWV3irbA8yN9SFcGUWzwuhdEZ266I78Ar5bR6dQYVnHRaydBhgjBDP2eCNe4283DS5g== 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=IzZczbciWkpviMgPkA6SKBPbg7CqUWga/PXUzVJnLCk=; b=LJvHEV6vUGYojYqFbk0iWrGqJI/7wiuyZDlE+AUwWN815YekugGaRnn1EVa6lsR0ix5SfDTME/oFxq+vHMYLoyKx1AOrvYIr7uJ481sqnFarn3eLPbpBkHC/3fSwTzZ7tuATCym4NVWn4PAh63YfBG+ck6WYqrLbXhCWI+GV+2Wnhn792lH7U//bJeEiSMqT3HXAc3/L6qL58fwUISTG1ssEscC1WH0Ax+viYv/RozIWdFJTlTxuHz/JwkOVVnc9j5fIXWXBRmvi1wVV7WEjFtFczLHDD7CkljxH4EO0/UhDrFMNJUojqKyq3XQFNjRxo/xZVUwJcClWrSkYiUT/1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SJ0PR11MB6621.namprd11.prod.outlook.com (2603:10b6:a03:477::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Fri, 2 Feb 2024 09:41:06 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::df88:b743:97f8:516c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::df88:b743:97f8:516c%5]) with mapi id 15.20.7249.027; Fri, 2 Feb 2024 09:41:05 +0000 Date: Fri, 2 Feb 2024 09:40:59 +0000 From: Bruce Richardson To: Thomas Monjalon CC: Ashish Sadanandan , , , , , , , Subject: Re: [PATCH 1/1] eal: add C++ include guard in generic/rte_vect.h Message-ID: References: <20240202051335.776290-1-ashish.sadanandan@gmail.com> <5751086.DvuYhMxLoT@thomas> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5751086.DvuYhMxLoT@thomas> X-ClientProxiedBy: DU2P251CA0030.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::30) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ0PR11MB6621:EE_ X-MS-Office365-Filtering-Correlation-Id: a3e731f0-a192-472a-c0d1-08dc23d313cb X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3O/m2qv4XpP7XhP1vIfAnQx3NJU3aFCdXxcobxcb5E1W3w3VzupZe4VneTTfNlS4nmp4BnIMQldRiLQ0JLlMtv6MHyjs96Db4vjGgLWVgUgzHBUGrNNXbxYb+9HiLuaJuEvUq/jyqRN42Z6V/0/27WeNGR4x5j61V6W98KLfW2Oz5Z4kSK9AUXL1qCKf/7ubiJcc9FLdLXhB0lLbGUUrrQNb0U63388RXd6DveTLgZVPhMIFtqiB0h7eiRE6/xFPIo++5cFycgXovxFEXHQDfAGm2rwndAqGkIAJYvRnFi7DyJqdbBvEJq09GlI8phnrr7LuHO8v0VFuvT4z1XfqAjxZgoB8bx2cu0q3Sg+l658YxM01x6h5m5oPwoyACrTE3fWy98f1UFFfy+SPmW4vAw5G8SJR2vO8t5Eb8joyptEyHGEVzKR+o8ofRHuhbCv9x2PEEaUrt1053QY+2qXk+kgxlEuvo5K2hPOfU/T7fuHs/PMgnO9sJqusog7WSc92vhYCQwOgAZVZFjrtNlA06sNfzwj/UdmxU8tmrDO5gRC8EpKyXuB1BipE+9M5GTomokc5OHyfwIBXtXbXh5p5m5Kxub1B/9HXeqKTxqoyrio= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(136003)(366004)(376002)(346002)(396003)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(44832011)(2906002)(8676002)(4326008)(8936002)(86362001)(66946007)(66476007)(66556008)(5660300002)(38100700002)(6916009)(6512007)(82960400001)(6506007)(316002)(478600001)(6486002)(6666004)(83380400001)(41300700001)(26005)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?83modcZQ4C3nx6W7zIC6pFCxjE8hfpTmzMf0f+VpT8VX15LKWRdD7sP/h6SP?= =?us-ascii?Q?wVYWjAHGbmZe5E1+dK+SGhfctlZwwHXRS6RAuSd3koK/I7LLxS3sKodk5LrJ?= =?us-ascii?Q?ML78b8byecMFMisHa5GV4Dj6pEO03Zz3/ytnmTaZYfwF9Llb5bQ98pMLL3NU?= =?us-ascii?Q?hSbsHfzbHev8PZGIGqGUm4sde4Z5u1hzJaJ0cqUx/iEhZlwWhhff813SqRj+?= =?us-ascii?Q?ZMQt6d0ANOBNMlS3nobEIe3EiWxlf+Z8/puKIRp86G9gAdHzlqAh1xutUmxJ?= =?us-ascii?Q?4SGUJmijxTzILXl2DTJCQk2TYSGXzjNqusTm9/w+ixcrVkXPOHzr7QqoTA7B?= =?us-ascii?Q?ZZT6q2/43tYqJE8SOtGs2D1BWVfbsaMdYp8CgVQ8THNxexXcIcEpxxfUbaTI?= =?us-ascii?Q?+dCnFQIRUsZVdQ13qG6MR/lrfL2yBK/Yr2kXjEvyoSHO0zDR5rRkUEEMJK50?= =?us-ascii?Q?U7OxFscaFtPP1QAQVMcjFWcUICrUQgqfv6/xvTaR1mcStqhONATfFM2A/33C?= =?us-ascii?Q?DWE6Ow48oU38dTEzt33MPKcN1CLkV2E7fs8yuNYL+SJvw6q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kldZkbLsoma4SYoPg2Y1txnZAspb?= =?us-ascii?Q?zYGnJsZ15oHfhLVo2mQEWtzvgTspLyvEfqvQ7tASA0/KYKDYk7ZGUA0TPD/2?= =?us-ascii?Q?3iGPWW7A/8buKo7Ud4PLQPq29ghau9N3HUVBTxYrjWnkjEvCKpD8vyJwtCd7?= =?us-ascii?Q?SQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: a3e731f0-a192-472a-c0d1-08dc23d313cb X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 09:41:05.8792 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0YhpKdj/VvxamtmFoXnqCCiK1INclXBiqr8PddM1TVcCkxshJWFCa9X2zz5F/qtr0elDBcvbB+Z9lBmJTjO8hiVy+nuKnudh5Eq1pVwCw2Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB6621 X-OriginatorOrg: intel.com 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 Fri, Feb 02, 2024 at 10:18:23AM +0100, Thomas Monjalon wrote: > 02/02/2024 06:13, Ashish Sadanandan: > > The header was missing the extern "C" directive which causes name > > mangling of functions by C++ compilers, leading to linker errors > > complaining of undefined references to these functions. > > > > Fixes: 86c743cf9140 ("eal: define generic vector types") > > Cc: nelio.laranjeiro@6wind.com > > Cc: stable@dpdk.org > > > > Signed-off-by: Ashish Sadanandan > > Thank you for improving C++ compatibility. > > I'm not sure what is best to fix it. > You are adding extern "C" in a file which is not directly included > by the user app. The same was done for rte_rwlock.h. > The other way is to make sure this include is in an extern "C" block > in lib/eal/*/include/rte_vect.h (instead of being before the block). > > I would like we use the same approach for all files. > Opinions? > I think just having the extern "C" guard in all files is the safest choice, because it's immediately obvious in each and every file that it is correct. Taking the other option, to check any indirect include file you need to go finding what other files include it and check there that a) they have include guards and b) the include for the indirect header is contained within it. Adopting the policy of putting the guard in each and every header is also a lot easier to do basic automated sanity checks on. If the file ends in .h, we just use grep to quickly verify it's not missing the guards. [Naturally, we can do more complete checks than that if we want, but 99% percent of misses can be picked up by a grep for the 'extern "C"' bit] /Bruce