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 27D1D43008; Wed, 9 Aug 2023 13:19:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B41B840691; Wed, 9 Aug 2023 13:19:15 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C682B400D6 for ; Wed, 9 Aug 2023 13:19:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691579953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9LcBLDiVehBSq2nzieyLoaj0PhGE/9/zg83O9eV8APU=; b=buHaW1J9KdYMLWaerfueW7wTl2FQJLtAeat5YBR/lqMMuFewJaztTEAOp/57B/5MhCIDsK 8DKiP+mjE/c1Usb7I6yxi/Di0jH5p0tbVvm4TZ/xtZe8mgWCO4owiq2Cp4KSm1DEqzCAE3 kkXayIDDpBakY8haEVc7d6oKhkI0F+c= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-d1qYstP1MIC_vadmbpwP3w-1; Wed, 09 Aug 2023 07:19:09 -0400 X-MC-Unique: d1qYstP1MIC_vadmbpwP3w-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b9f0b7af1cso72747031fa.3 for ; Wed, 09 Aug 2023 04:19:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691579948; x=1692184748; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9LcBLDiVehBSq2nzieyLoaj0PhGE/9/zg83O9eV8APU=; b=FVZsFF3FR0uaqKmva9SVULLJyRi0nA/FYTixAI/xt1wiI3ec7KYnpLtlfDD+8Xv72Z 7YpuMRjBWPbNoFcdiS7QTQMZBnkLtDjLqgNQXDlABslGdGfZZxqGxtC8WJtLBLNM7gJm 0B/feebT7WXATiOsN07HPpcLw1o99Bnz+Bl04EIDz2jY2Z7Ry+766L6o5pXTQI+CMBL4 1wNpl5jWk2ZazF+/ybeo9yWzJ1BBKrBv9BYXuUAWXXTSGw/jbRpLl0W9EZ+g9iCBlBkj yia4C1+doG77dqn5SNwQRQeDKaqQ/9fHJ0JD67OXiNZ1mLIa8QLhoj9EODBbt2R3NG5n rKew== X-Gm-Message-State: AOJu0YzjyFZeTfPoiFF7EVdDDVrVsc7xW05n02CUoSRy2h9V7gdEdurL h7ah6H8ng1qFjhkJX5otpfRaZtDtSGSmmc/vLDOrcAyoEzcbFQaSSapddpCTHLJGUfYC5aYt3Ze rMok+l/V/BJfCRGDJvWA= X-Received: by 2002:a2e:998c:0:b0:2b9:e831:f16a with SMTP id w12-20020a2e998c000000b002b9e831f16amr1540810lji.26.1691579948524; Wed, 09 Aug 2023 04:19:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxYOousP64RN6wXEP6Ki/BPQzpLb5LxBZkvhK5oLPs7WSuPnT78aGcc6Cdf5Bd3mai8cWqkeUrVyfEAe2gwSA= X-Received: by 2002:a2e:998c:0:b0:2b9:e831:f16a with SMTP id w12-20020a2e998c000000b002b9e831f16amr1540792lji.26.1691579948201; Wed, 09 Aug 2023 04:19:08 -0700 (PDT) MIME-Version: 1.0 References: <20220829151901.376754-1-bruce.richardson@intel.com> <20230731153902.2350026-1-bruce.richardson@intel.com> <20230731153902.2350026-2-bruce.richardson@intel.com> In-Reply-To: <20230731153902.2350026-2-bruce.richardson@intel.com> From: David Marchand Date: Wed, 9 Aug 2023 13:18:56 +0200 Message-ID: Subject: Re: [PATCH v7 1/3] eal/windows: move fnmatch function to header file To: Bruce Richardson Cc: dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= , Tyler Retzlaff X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, Jul 31, 2023 at 5:39=E2=80=AFPM 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. I have also a comment on sccsid, see below. > > Signed-off-by: Bruce Richardson > Acked-by: Morten Br=C3=B8rup > 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[] =3D "@(#)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] > @@ -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; --=20 David Marchand