git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] grep.c: Fix a sparse warning

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 18, 2012, 19:49 UTC
Message-ID
<7v7grrm7qr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<5058AFB1.3040600@ramsay1.demon.co.uk>
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
Show 17 quoted lines
> In particular, sparse complains that "... 'dump_grep_expression'
> was not declared. Should it be static?". In order to suppress
> the warning, since this function does not need more than file
> scope, we simply include the static modifier in it's declaration.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
>
> Hi Junio,
>
> I prefer to catch these before they progress to next, but it seems
> I've not been quick enough lately! Sorry about that. :(  [I will have
> to git-fetch more frequently; at present I only fetch about 3 times
> a week.]
>
> I've been away for a few days, so I'm well behind ... (I'm just
> about to download 350+ emails for me to read tonight!).

Thanks; doesn't 07a7d65 (grep.c: mark private file-scope symbols as static, 2012-09-15) cover this already, though?

Show 19 quoted lines
>
> ATB,
> Ramsay Jones
>
>  grep.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/grep.c b/grep.c
> index 925aa92..38c4d75 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -403,7 +403,7 @@ static void dump_grep_expression_1(struct grep_expr *x, int in)
>  	}
>  }
>  
> -void dump_grep_expression(struct grep_opt *opt)
> +static void dump_grep_expression(struct grep_opt *opt)
>  {
>  	struct grep_expr *x = opt->pattern_expression;
Previous: Ramsay Jones
Message 2 of 2 in “grep.c: Fix a sparse warning”
  1. grep.c: Fix a sparse warningRamsay Jones, Sep 18, 2012
  2. Junio C HamanoSep 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.