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 349FD43CB2 for ; Thu, 14 Mar 2024 04:45:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25728427E3; Thu, 14 Mar 2024 04:45:26 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 13315400D5; Thu, 14 Mar 2024 04:45:24 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 014EE20B74C0; Wed, 13 Mar 2024 20:45:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 014EE20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710387923; bh=iJtPGnZL/jQxugfZx8klq0rks7D5sVldiOnLNEr3ewo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cchso/eH6ffdJ7651kEn3th/Ffwl5VC1ykfIlHNQoUOJ30nF0L8TYFt0eRRLyl3ov Q69eaIw/DkslHMYtQNSIYyylNXYa6pRkrWH0dq6VKXWHA5oXyfu5vla4OBZjwXd//v lZVTPZjwcKYznUrS5je+yKq7JuJnGKP7RPOmBi1o= Date: Wed, 13 Mar 2024 20:45:22 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: Ashish Sadanandan , Bruce Richardson , Thomas Monjalon , 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 Subject: Re: [PATCH 1/1] eal: add C++ include guard in generic/rte_vect.h Message-ID: <20240314034522.GA20126@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20240202051335.776290-1-ashish.sadanandan@gmail.com> <5751086.DvuYhMxLoT@thomas> <20240313164536.11fff597@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240313164536.11fff597@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, Mar 13, 2024 at 04:45:36PM -0700, Stephen Hemminger wrote: > On Fri, 2 Feb 2024 13:58:19 -0700 > Ashish Sadanandan wrote: > > > > 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 > > > > > > > 100% agree with Bruce. It's a valid ideological argument that private > > headers > > don't need such safeguards, but it's difficult to enforce and easy to break > > during refactoring. > > > > - Ashish > > But splashing this across all the internal driver headers is bad idea. > It should only apply to header files that exported in final package. while we don't provide api/abi stability promises for driver headers we do optionally install them with -Denable_driver_sdk=true. the driver sdk allows drivers to be developed outside of the dpdk source tree, many such drivers are explicitly authored in C++ and are outside of the dpdk source tree because dpdk does not allow C++ drivers in tree.