public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: ltp@lists.linux.it
Cc: Richard Palethorpe <rpalethorpe@suse.com>
Subject: Re: [LTP] [PATCH 1/3] tools/sparse: Add static check
Date: Wed, 24 Nov 2021 10:00:31 +0000	[thread overview]
Message-ID: <87pmqplvnf.fsf@suse.de> (raw)
In-Reply-To: <20211123124348.31073-2-rpalethorpe@suse.com>

Hello,

Richard Palethorpe <rpalethorpe@suse.com> writes:

> This was adapted from Sparse's inbuilt check_duplicates (-Wdecl). The
> original check appears to print a warning whenever a symbol is
> non-static, but has no prototype. It appears to work because library
> symbols are usually declared first in a header file and then again
> with their definition in a source file.
>
> The LTP version also checks for the various library prefixes, but
> should otherwise be the same.
>
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
>  tools/sparse/sparse-ltp.c | 53 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 53 insertions(+)
>
> diff --git a/tools/sparse/sparse-ltp.c b/tools/sparse/sparse-ltp.c
> index 45874e8eb..73725d191 100644
> --- a/tools/sparse/sparse-ltp.c
> +++ b/tools/sparse/sparse-ltp.c
> @@ -82,6 +82,57 @@ static void do_entrypoint_checks(struct entrypoint *ep)
>  	} END_FOR_EACH_PTR(bb);
>  }
>  
> +/* Check for LTP-003 and LTP-004
> + *
> + * Try to find cases where the static keyword was forgotten.
> + */
> +static void check_symbol_visibility(struct symbol *sym)
> +{
> +	struct symbol *next = sym;

Ooops, we don't need next anymore.

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2021-11-24 10:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 12:43 [LTP] [PATCH 0/3] tools/sparse: Add static check Richard Palethorpe via ltp
2021-11-23 12:43 ` [LTP] [PATCH 1/3] " Richard Palethorpe via ltp
2021-11-24  7:12   ` Petr Vorel
2021-11-30  8:24     ` Richard Palethorpe
2021-11-30 10:19       ` Cyril Hrubis
2021-11-30 10:23         ` Cyril Hrubis
2021-11-30 10:33           ` Richard Palethorpe
2021-11-30 10:51             ` Cyril Hrubis
2021-11-30 11:43             ` Cyril Hrubis
2021-11-24 10:00   ` Richard Palethorpe [this message]
2021-11-29 10:16   ` Cyril Hrubis
2021-11-23 12:43 ` [LTP] [PATCH 2/3] doc: Add LTP-003 and LTP-004 static and tst API prefix rules Richard Palethorpe via ltp
2021-11-24  7:18   ` Petr Vorel
2021-11-29 10:17     ` Cyril Hrubis
2021-11-29 10:33       ` Petr Vorel
2021-11-29 10:44   ` Cyril Hrubis
2021-11-23 12:43 ` [LTP] [PATCH 3/3] statx: Add missing static keyword to tcase variable Richard Palethorpe via ltp
2021-11-24  7:19   ` Petr Vorel
2021-11-29 10:16     ` Cyril Hrubis

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=87pmqplvnf.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.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