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 70D474238D; Fri, 13 Jan 2023 18:31:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21DCF410EF; Fri, 13 Jan 2023 18:31:29 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 79A2A40E03 for ; Fri, 13 Jan 2023 18:31:27 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id B70F120DED16; Fri, 13 Jan 2023 09:31:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B70F120DED16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1673631086; bh=SjJ0Opk0asy33rPxHuEPZq1vCMKf20G3aop1dWkpkBw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ae756BQvd0SZgpak74LQ+QwLNEi57KW9v0LWO01t1zA0uBZfAr5etCzSQRfyA0s/K oYYiozROPnZopOoXfF4wWtycC56Qw6hkVcnD6ywRTPlNf/3niglBqIHvTCOcIy0WUk 4Qjhg85qdhvnzzrGEMJ/VmbOBocLFZNVJIVCvLYk= Date: Fri, 13 Jan 2023 09:31:26 -0800 From: Tyler Retzlaff To: Bruce Richardson Cc: Morten =?iso-8859-1?Q?Br=F8rup?= , dev@dpdk.org, david.marchand@redhat.com Subject: Re: [RFC PATCH v2 1/3] eal/windows: move fnmatch function to header file Message-ID: <20230113173126.GC28592@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20220829151901.376754-1-bruce.richardson@intel.com> <20230113162001.519534-1-bruce.richardson@intel.com> <20230113162001.519534-2-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D8766F@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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, Jan 13, 2023 at 05:01:20PM +0000, Bruce Richardson wrote: > On Fri, Jan 13, 2023 at 05:41:29PM +0100, Morten Brørup wrote: > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > Sent: Friday, 13 January 2023 17.20 > > > > > > To allow the fnmatch function to be shared between libraries, without > > > having to export it into the public namespace (since it's not prefixed > > > with "rte"), we can convert fnmatch.c to replace fnmatch.h. This allows > > > fnmatch function to be static and limited in scope to the current file, > > > preventing duplicate definitions if it is used by two libraries, while > > > also not requiring export for sharing. > > > > > > Signed-off-by: Bruce Richardson > > > --- > > > > [...] > > > > > #define FNM_CASEFOLD 0x10 > > > #define FNM_PREFIX_DIRS 0x20 > > > > > > +#define EOS '\0' > > > > Careful about names in header files. Perhaps EOS should also have the FNM_ name space prefix to reduce the risk of collision. Or even better: just use '\0' in the code instead of defining a special name for it. > > > > > + > > > +static const char *rangematch(const char *, char, int); > > > > I don't think rangematch() is a POSIX function, so similar comment here. Prefix with fnm_ to reduce risk of collision. > > > > With those fixes... > > > > Series-acked-by: Morten Brørup > > > > Sure, I can prefix those. > > However, since this is a non-published header, private to the DPDK build, > the only chances of collision come from the DPDK files which include the > header. The objective of making it a header was so that none of this ever > leaks outside of the DPDK libs that use the functions internally. That > said, there is no harm in prefixing either, so I'll do so in any future > version. and if a future collision occurs we should be able to adapt without compat break. you know for platforms that step on the application namespace... *cough* legacy windows headers. thank you for doing this Bruce. Series-acked-by: Tyler Retzlaff