From: David Marchand <david.marchand@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, "Morten Brørup" <mb@smartsharesystems.com>,
"Tyler Retzlaff" <roretzla@linux.microsoft.com>
Subject: Re: [PATCH v7 1/3] eal/windows: move fnmatch function to header file
Date: Wed, 9 Aug 2023 13:18:56 +0200 [thread overview]
Message-ID: <CAJFAV8xaUi6kZLcz8t=kFCmHb7eef=+aqpdhu1tfTPzir8Ayjg@mail.gmail.com> (raw)
In-Reply-To: <20230731153902.2350026-2-bruce.richardson@intel.com>
On Mon, Jul 31, 2023 at 5:39 PM Bruce Richardson
<bruce.richardson@intel.com> 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 <bruce.richardson@intel.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
[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]
> @@ -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
next prev parent reply other threads:[~2023-08-09 11:19 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 15:18 [RFC PATCH 0/3] Split logging out of EAL Bruce Richardson
2022-08-29 15:18 ` [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL Bruce Richardson
2022-08-29 18:57 ` Morten Brørup
2022-08-30 8:41 ` Bruce Richardson
2022-08-30 8:42 ` David Marchand
2022-08-30 9:59 ` Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 2/3] log: separate logging functions out of EAL Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 16:19 ` [RFC PATCH v2 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 16:19 ` [RFC PATCH v2 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 16:41 ` Morten Brørup
2023-01-13 17:01 ` Bruce Richardson
2023-01-13 17:31 ` Tyler Retzlaff
2023-01-13 17:37 ` Bruce Richardson
2023-01-13 16:20 ` [RFC PATCH v2 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 16:20 ` [RFC PATCH v2 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 3/3] telemetry: use standard logging Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 3/3] telemetry: use standard logging Bruce Richardson
2023-01-22 14:56 ` [PATCH v4 0/3] Split logging functionality out of EAL David Marchand
2023-01-23 14:24 ` Bruce Richardson
2023-01-23 14:31 ` David Marchand
2023-01-23 14:36 ` Bruce Richardson
2023-01-23 14:42 ` David Marchand
2023-05-18 12:49 ` [PATCH v5 " Bruce Richardson
2023-05-18 12:49 ` [PATCH v5 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-05-18 12:49 ` [PATCH v5 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-05-18 12:49 ` [PATCH v5 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 15:38 ` [PATCH v7 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 15:39 ` [PATCH v7 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 11:18 ` David Marchand [this message]
2023-08-09 12:35 ` Bruce Richardson
2023-07-31 15:39 ` [PATCH v7 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 16:22 ` David Marchand
2023-07-31 16:29 ` Bruce Richardson
2023-08-09 10:00 ` Bruce Richardson
2023-08-09 11:58 ` David Marchand
2023-08-09 12:24 ` David Marchand
2023-08-09 12:32 ` Bruce Richardson
2023-07-31 15:39 ` [PATCH v7 3/3] telemetry: use standard logging Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 0/3] Split logging functionality out of EAL Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 3/3] telemetry: use standard logging Bruce Richardson
2023-08-11 12:46 ` [PATCH v8 0/3] Split logging functionality out of EAL David Marchand
2023-08-11 12:59 ` Bruce Richardson
2023-09-01 11:25 ` Thomas Monjalon
2023-09-01 12:26 ` Morten Brørup
2023-10-23 7:37 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJFAV8xaUi6kZLcz8t=kFCmHb7eef=+aqpdhu1tfTPzir8Ayjg@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
--cc=roretzla@linux.microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).