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 C687143B01; Mon, 12 Feb 2024 16:43:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B54724067E; Mon, 12 Feb 2024 16:43:21 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2065.outbound.protection.outlook.com [40.107.237.65]) by mails.dpdk.org (Postfix) with ESMTP id 9B6BA402D9; Mon, 12 Feb 2024 16:43:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hwnXwyUkozC16zrqj303yrUywYLGHVIhiiExiG4N4cLZOGn6DZg2tD3zt7k3SB3E+dv1QJ7rQJTFwNvpwtump++uMmEViVi3y+Ndq5lgNCie5HvMnI1OJqqXn5qZM3feb3r091m6IOhS1CDRu51KWiygP8wXVPirRsESMG4Fv344AdnlgBaxUO8swBb3g5DZ9Pv9c5Ois+WMzUIECnouTV1EuCVM7s/DqOkwypDFJyKTO03us1oAYRfkDedGtu56fIEErRJVa+/kKn5+d3kkyrcghSZq1Nz66mM+ZNUhtqQdTPybmTJBHjMW27b6xR467MghcL0zBE9GIl7xUWKacg== 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=jz4hShdmVWfDgTXk0arYGTuhqEkFyKOwxn+S2ON4kek=; b=fUxzt9j++UfT+uYfB0PQV4AugUbRxI9Y+YpqsHqgEXpINnUow8pxgrgRX5indIbZj6hPRXlr4RwgkDuJtAKxm/QBAIAzPSk3+gT/qGnDdfwgXGAPFDJMNxcINdIwzJ2AnQYylL8yyD2Ck7Itv3YhIAupHFEO37o5iQ94V1sGnWbgGTfp0sHu/1GlXkOrmBLembxdqzPUjB4P8LAkhbOXBaFWWy9MCD2dLwAD/dqq27liQTPNxyp2FPT611JxJ47+IGDiyyAxC/50eEXz6EXdvDeWzGs/2HyVorVQreSBw8cVflbLwGU6tjFi8LeweKF0rx6m4AwnKkeiewszP4nosA== 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=jz4hShdmVWfDgTXk0arYGTuhqEkFyKOwxn+S2ON4kek=; b=5Ukq2eKWNlfMdI430NmKbNGOVNySd7xUiRaeJziq3U+ngONxCPkGbbEy/2ZDErE4CRnqKfiOKmILtVbBkgToswR5xL+XLpYEszvjFuZ3t7ZcIuoghcZc6BuYAqsLa4tWB2WilAu6tVm+Cwff6gHTba46JirWRoYqtfsx/Man53w= 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 DM4PR12MB7768.namprd12.prod.outlook.com (2603:10b6:8:102::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.24; Mon, 12 Feb 2024 15:43:18 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529%4]) with mapi id 15.20.7292.022; Mon, 12 Feb 2024 15:43:18 +0000 Message-ID: <3fda997a-8e3d-447d-9b6d-01d48defb670@amd.com> Date: Mon, 12 Feb 2024 15:43:16 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] eal: add C++ include guard in generic/rte_vect.h Content-Language: en-US To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Tyler Retzlaff , Bruce Richardson Cc: Thomas Monjalon , Ashish Sadanandan , dev@dpdk.org, nelio.laranjeiro@6wind.com, stable@dpdk.org, honnappa.nagarahalli@arm.com, konstantin.v.ananyev@yandex.ru, david.marchand@redhat.com, ruifeng.wang@arm.com References: <20240202051335.776290-1-ashish.sadanandan@gmail.com> <5751086.DvuYhMxLoT@thomas> <20240205173652.GA2935@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35E9F1EA@smartserver.smartshare.dk> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc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dTIDQYp545+TPV7oyF0LfXcsQs SFVZE6igdvkjfYmh+QOrHGZvpWXLTmffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F1EA@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0377.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18e::22) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB7768:EE_ X-MS-Office365-Filtering-Correlation-Id: 76e48068-b621-429f-3ad1-08dc2be155c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uOBNeHcCU/IOzlYlwUMV3+TqlhQ5VpqlHgF5Hym3HxkskerSIQoP26Hfcwv45fT0pR6z+oU2Tr/AGnFSsGVF5Im0+w0qtUCtB6BwTyT9E0dSKuZXiSt2PdL0sp5P9w8BSAPFzqy6pVYh2FFeHFUdUgRUEkbdwseZdBDG0Z/+40uawAtacfdPLEnBl2asFDQCfGJZEudWin6dWeU0d11W6/0iJcbfKFATPDW+H4MKgGJXQY4bJn/c3CUxseZcDoCLcTdq+Hc1PpEUor8zIE9mejr76HuknsJckEIbHyXBM42e1IASxgK+FEUDOIk0aBF0ZjObR54BYgHSprhbzjJMbvNMDkIVLPFWegrtHP3OUmxobTXqDJKv6lu/VvDmFOtPEknSV2bOuz4StdRcn7zgPKY4e9KfFG43Q1WKjdm8R7pzfC6WkGi6TZK6dXGyo9mj2cXE37b/TW8oi4bpirq9GdecL8BBrtmg4hHYKDr7XC7L7OLw183N8gQHbXxALJAyK9+j2pNCec7FGQHI/ESrL5ECx7eS0hXnCoF5d6TUigkF03kgU0lZn4GEZPRnB6rb 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:(13230031)(136003)(39860400002)(396003)(376002)(366004)(346002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(4326008)(8676002)(8936002)(7416002)(5660300002)(2906002)(44832011)(66899024)(66574015)(26005)(2616005)(36756003)(38100700002)(86362001)(31696002)(110136005)(54906003)(66476007)(66946007)(83380400001)(316002)(66556008)(6506007)(6512007)(53546011)(478600001)(6486002)(31686004)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q0F6d0JGVzlHazVlUUFvUWZBOTRmU2ZqaGk5bXYyRm54RUtiZXNSclNZTDA2?= =?utf-8?B?REJHRUJKSXJVc3FYQ213cTZ5a3lWd2lrbEQ0RmlVOWJjcUwwdUxmWElkYlIv?= =?utf-8?B?bU01bElnWHR5bGUyMDlPSFJOZkp5VG9UV1VvdmFFMmJtV2VISVhhYWdXWlF2?= =?utf-8?B?dFRheHJrU1Q5MStsd3BLeTk1K04xVk92Z2RpeXRXMXRsMkNVUEhoUUx5ajFK?= =?utf-8?B?RHdSamRSL0tXRUY3SkIveW51YmhIR09HUEFSODI5NWhjdkg1ZkUzbElJS0dm?= =?utf-8?B?UlRyalFNejJ4aElpb0VmR3lwYy9XVm9maXVkN24wUEU5c1NBd3VON1diR3px?= =?utf-8?B?TTltbzBqRzVXQkZUUHJ2WWxGTFZhSzg4SW5uVG5DQkdrQzhIQWZIc1QyZDdP?= =?utf-8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c6 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:43:18.7610 (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: LZ2Po9x8piOBMi7ynmGyqnNsyO/1wnedu66xPoZldE8VeEC6eMSum2xnNJWliF+x X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7768 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 2/5/2024 9:07 PM, Morten Brørup wrote: >> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] >> Sent: Monday, 5 February 2024 18.37 >> >> On Fri, Feb 02, 2024 at 09:40:59AM +0000, Bruce Richardson wrote: >>> 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] >> >> so first, i agree with what you say here. but one downside i've seen >> is that non-public symbols may end up as extern "C". >> >> i've also been unsatisfied with the inconsistency of either having >> includes in or outside of the guards. >> >> a lot of dpdk headers follow this pattern. >> >> // foo.h >> #ifdef __cplusplus >> extern "C" { >> #endif >> >> #include >> >> ... >> >> but some dpdk headers follow this pattern. >> >> // foo.h >> #include >> >> #ifdef __cplusplus >> extern "C" >> #endif >> >> ... >> >> standard C headers include the guards so don't need to be inside the >> extern "C" block. one minor annoyance with always including inside the >> block is we can't reliably provide a offer a C++-only header without >> doing extern "C++". > > I would say that the first of the two above patterns is not only annoying, it is incorrect. > A DPDK header file should not change the meaning of any other header files it includes. > And although the incorrectness currently only screws up any C++ in those header files, I still consider it a bug. > Should we document the proper extern "C" usage somewhere?