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 633E643018; Wed, 9 Aug 2023 14:35:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC89940691; Wed, 9 Aug 2023 14:35:42 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 4E242400D6 for ; Wed, 9 Aug 2023 14:35:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691584541; x=1723120541; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=AIMRZsYfvoY20M3Iugbg1K+9S1FS2QIza3ivKadCcNw=; b=KFIsNScwWQGzKvxRj7GBOYHp8cDELLdSc6Quk5ajUhi0pcj+at5koz/9 gaVmgttu/47ER+Pxy7xd5GUzpFxwQ7C/tKTxkoTGoFWEg7/QFr6kHEVA2 Ac3Rhm26ANiqaNDw/9kB5MJ8VlGO5rHqfusgqk3sLbmDOSVk7mAxguoFY /0q9u86d4xG73ojKFpyuXn9N/odn7OJX92aghoA1Ni8SyjvIFc37CyWK/ qFf5SrzuLz6L24O0TCoTRJ50edrdX5nwTm+NFXc62b/lzeJ6h4nOKbhvQ TB3GG/AyNpYGuljfpmYzY/9TNsQqO/W+wFVWslKeF3Z+0FHGqI3IolmzK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="434997549" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="434997549" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 05:35:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="797162581" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="797162581" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga008.fm.intel.com with ESMTP; 09 Aug 2023 05:35:39 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 9 Aug 2023 05:35:39 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 9 Aug 2023 05:35:39 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Wed, 9 Aug 2023 05:35:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WpfAqEKlHGPpv/AR8mZ0Y9qxtuKuFkuXVYCaUoFEM+gELbWmcRjWMuomlNTdskRB/W/NRng8wySaQzNM4uyk7ZbZA6OwiyaMMUKa5AIzYCIrxztV7zZOQHK2HTJFm3BndG49m8gbE/er4fZ9MO/ecjVXhDSxycfIfg9AzGXexZ6wB4AA2lXrAzLTuDY/nSLutHsd/ikhZS56HiWIjuSxrHv4uqasqmp1pRZR28W+k1S6LXpPB//vPJJ5wQTa0apufxaqmBFFV3TZnldVEmrYeMktKneB5lwrc3a+K+G5z2Y/GldOs5AE1y0DOV5b+HvfbgGkjL+73Dq1UX0fg02wiA== 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=uCn71kv5t0nhgoIL2bB8EbPToiucglLRh2mVWUM0r4s=; b=eV19oxOijEKhT0Bn+EAvb1VDyml7swH529EYXK5eMz+dPqmC/lfRCTrZH8bcVGRq4vyILibAb8Fl56QCQCiYdVE40y7wlvI47UrptNgpwKUyoHtIqdtN3bNceJq0HQAMnHE3d7jTpgQZsYzQ6h1AXrlMij+PY7zo7fk/E1XtoEv+SFH/2MAf+pmQhG/xof3/AF9nDrDwLdyTWcd4agtPnUYXjwiRJTN4IX7bl2gdW1npjEaTBEtL9A54jQFz7Tn1VBnZFBrsaOH4pkTSonUgIc56Hrkx/cceuIo92lxUBX/MbfKY3cWbMzwm2WwGmHfmY+ZPHVtjLPLF5ENMRn671Q== 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 PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Wed, 9 Aug 2023 12:35:37 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::9802:65f0:c441:780f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::9802:65f0:c441:780f%7]) with mapi id 15.20.6652.028; Wed, 9 Aug 2023 12:35:36 +0000 Date: Wed, 9 Aug 2023 13:35:30 +0100 From: Bruce Richardson To: David Marchand CC: , Morten =?iso-8859-1?Q?Br=F8rup?= , Tyler Retzlaff Subject: Re: [PATCH v7 1/3] eal/windows: move fnmatch function to header file Message-ID: References: <20220829151901.376754-1-bruce.richardson@intel.com> <20230731153902.2350026-1-bruce.richardson@intel.com> <20230731153902.2350026-2-bruce.richardson@intel.com> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DUZPR01CA0307.eurprd01.prod.exchangelabs.com (2603:10a6:10:4ba::23) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|PH8PR11MB8107:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f9d7c8e-95a0-4f4a-188b-08db98d52186 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 47xFt787wi8JxhtrSWeZpotbKj5OI/Pq7lUodfJAHudKnK32dZ3mKnEV7xICS98lYc8b3V+bpEsKZ1zah+r26kPD+lOV/qxGwKLVexiO7XP68JMrwuCQtEMj1gJuP2mACDhKImsl/reKfqVtHASez9PGIsWopHM9zaxMGSN9C18bU9DljQzJ5scJ9ZYqGZBKZqObWh/PCfMYSN5UjBiyHpYWbnOIYOYy18arEUNtWq34cMH1hV0ZdVU3ZOkCMCTGAA5HQMWQsrFcol4x+tE6tECzseQTwP6ir+12OyVI+e09f2weo6Re9i5DvF/LGexuUZjaCqkFZ1nKm0hEhGdnFZwcUgNcc3exvaQaem6jOVo+NPsvOtedqmUB5rfOwnbz+5SIOYyG7hQjRXHtE64nZuU2JQj7p8Ud8pENeuTCKTbIms+VB7Gv+7inZD9Cy36cgW5WrIaNugfSpRzu/ufWHAc5VzWJVwjUcXyR/sALJ4wEWVO/eVyOz+ugtJR8MJfNQdSdznzRgKhpV7RnXpNYeYKDitgQTNBgrLdI39E3U3XmTc2C/KaTTOdp3VZrK1OL 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:(13230028)(39860400002)(136003)(396003)(366004)(376002)(346002)(1800799006)(451199021)(186006)(6916009)(6666004)(8936002)(86362001)(82960400001)(6512007)(41300700001)(6486002)(45080400002)(6506007)(26005)(478600001)(53546011)(316002)(8676002)(54906003)(44832011)(38100700002)(5660300002)(2906002)(4326008)(66556008)(66946007)(66476007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bExmbzhrOHFIS0lGMVZBbzJPeHhaR0ZmcHM5azQ2QmQ3MFNGTi9sWmJMbHBp?= =?utf-8?B?TWhoTDduRjJyMzhNbDFoT25rMWl1OWZtdndVdDREKzEzeFpJeFVIVVB2Nmd1?= =?utf-8?B?cDVCUEVWYVF2dEo0R1R3MEpVRDhwS1lpTDhBeVdKYlNJT2h0MFZZc25aNis2?= =?utf-8?B?U2w4Ri9vREtPMkVjVHpscHE4cEFFK0MwdjB5SnF6Z2RLbDc1L1RZbkhBOFVo?= =?utf-8?B?bGRYMEFLZnhyNTFPdERXcnFua1p4dVVqWEZFMkp0bktSSkxDbFA5SXh2YTBy?= =?utf-8?B?aFhST015T0xBOWEyODRIeThOVjdXbUpJajgyK0oxSHJXYU8vRHpxa1lPbDdS?= =?utf-8?B?N0JyODg3bHFXYmhhNjBPK2tDa05pdnBxTnB3QVJxWmxNRXZEL2VadFdiellS?= =?utf-8?B?c0JSZ25nRXE5bEl3ZWZaTnZIU1h4bFMxMXlObm1nM3NoUUtBNUZrbFBkUjRS?= =?utf-8?B?REloTXhoWTNjdk95ekJvakowTDdvdVQyUjJyWGRxUThycEJURnA2OGNLTnly?= =?utf-8?B?MUhUMmlxd2tSYUtIdmlkamJoU3EwVjh4RXc0KzVWZWpsVklKTTFkRGk2OEF5?= =?utf-8?B?cHVWRzIxU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NVkv?= =?utf-8?B?M1FwcDVaMFVzUlZtZjBCZXk0d0krQnl6TEdRQ3JZREJ0UEJNc3l1V0JaTG96?= =?utf-8?B?QldRaVN4Qm92WTJvc2d1OVY1WW1ML0R1dDRhdkQ1L00rNEFUK284dEUyNFgx?= =?utf-8?B?V2JvQXRkZWhZaHpUY1RRK1RKVW11bThGalpKcklaWmFCYUdMbWh2emZQN3BG?= =?utf-8?B?Q1Mza0lIYlNJWEZOaVZaZ2hVZGhqVTVxNkhRVis1RE81OVptd0V0N2FuSnE3?= =?utf-8?B?T1owaEw2T2ZjRVE0b2NGeGlHRmVhT3JKd3dOSFdyTVNEQ2N0MlJYRWJwSTdO?= =?utf-8?B?YklYSllSSDJaUkF3eU42R1BwNGFPWmlsNW54RytaYzF2MWs4LzlxcDdwMnEy?= =?utf-8?B?bDl2bENKU1UyTWpJN3pYRmVyck5RNGRtUEdIaGRqaFJabklSY251NWZGTkMy?= =?utf-8?B?Y2pSTXBXc1VLdm51cDgwT2NEMzBXTEhKUW9kczNUMExaR2VPWHpkcjJWVDJi?= =?utf-8?B?WDdEVnEvK0JKSTc5L0I4eFE1ejkwVGcvZ2JCZ2p5UDhCOVJHeFdVNHYxMG1j?= =?utf-8?B?dmpubGhyc2JSdXgwWXBJV2NiZ0tKdXdoRWZSQnZEWnF4aWZmYnVWcm1nWUg3?= =?utf-8?B?WnlCM294eDhkQW9jYkx6NEFiQWMvbzZVTGpMSk5JMVNobStpemIvUzRuNHpt?= =?utf-8?B?dUE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5f9d7c8e-95a0-4f4a-188b-08db98d52186 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2023 12:35:36.7256 (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: vfnFpy4m5aioJDrHQXgL/GHA84V3nBlyvkxQxutZvv930x5He4hPWrT1eEe3DemzcTo2XjzVzO+zfDGvwsFlHs7pu6vbJ5G9LnemnhEObPA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB8107 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 Wed, Aug 09, 2023 at 01:18:56PM +0200, David Marchand wrote: > On Mon, Jul 31, 2023 at 5:39 PM Bruce Richardson > wrote: > > > > 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. > > Overall, it lgtm. > > I am surprised those 3 static symbols (see below) do not require being > marked "inline" (to avoid "unused symbols" warnings). > The CI looks ok, so probably I am just paranoid. Only the functions should need the inline, and I suspect that we don't get any warnings, since the only files including the header always use the functions. Will mark them as inline just in case in next version. > > I have also a comment on sccsid, see below. > > > > > > Signed-off-by: Bruce Richardson > > Acked-by: Morten Brørup > > Acked-by: Tyler Retzlaff > > --- > > [snip] > > > diff --git a/lib/eal/windows/include/fnmatch.h b/lib/eal/windows/include/fnmatch.h > > index c6b226bd5d..fbf1eef21c 100644 > > --- a/lib/eal/windows/include/fnmatch.h > > +++ b/lib/eal/windows/include/fnmatch.h > > @@ -1,20 +1,25 @@ > > /* SPDX-License-Identifier: BSD-3-Clause > > - * Copyright(c) 2019 Intel Corporation > > + * Copyright (c) 1989, 1993, 1994 > > + * The Regents of the University of California. All rights reserved. > > + * > > + * This code is derived from software contributed to Berkeley by > > + * Guido van Rossum. > > */ > > - > > #ifndef _FNMATCH_H_ > > #define _FNMATCH_H_ > > > > -/** > > - * This file is required to support the common code in eal_common_log.c > > - * as Microsoft libc does not contain fnmatch.h. This may be removed in > > - * future releases. > > +#if defined(LIBC_SCCS) && !defined(lint) > > +static const char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94"; > > +#endif /* LIBC_SCCS and not lint */ > > Strange to keep this (what looks to be a canary) symbol in a header file. > > [snip] > Yeah, missed that, can probably be removed. > > @@ -25,6 +30,10 @@ extern "C" { > > #define FNM_CASEFOLD 0x10 > > #define FNM_PREFIX_DIRS 0x20 > > > > +#define FNM_EOS '\0' > > + > > +static const char *fnm_rangematch(const char *, char, int); > > + > > /** > > * This function is used for searching a given string source > > * with the given regular expression pattern. > > [snip] > > > > @@ -41,10 +50,150 @@ extern "C" { > > * @return > > * if the pattern is found then return 0 or else FNM_NOMATCH > > */ > > -int fnmatch(const char *pattern, const char *string, int flags); > > +static int > > +fnmatch(const char *pattern, const char *string, int flags) > > +{ > > + const char *stringstart; > > + char c, test; > > > -- > David Marchand >