Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494486

Re: [PATCH 00/15] improve function-level documentation

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [PATCH 00/15] improve function-level documentation
Date 2016-10-01 22:40 +0200
Message-ID <snzeF-5cE-5@gated-at.bofh.it> (permalink)
References <snyLD-4Z6-3@gated-at.bofh.it> <snz4Z-590-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On Sat, 1 Oct 2016, Joe Perches wrote:

> On Sat, 2016-10-01 at 21:46 +0200, Julia Lawall wrote:
> > These patches fix cases where the documentation above a function definition
> > is not consistent with the function header.  Issues are detected using the
> > semantic patch below (http://coccinelle.lip6.fr/).  Basically, the semantic
> > patch parses a file to find comments, then matches each function header,
> > and checks that the name and parameter list in the function header are
> > compatible with the comment that preceeds it most closely.
>
> Hi Julia.
>
> Would it be possible for a semantic patch to scan for
> function definitions where the types do not have
> identifiers and update the definitions to match the
> declarations?
>
> For instance, given:
>
> <some.h>
> int foo(int);
>
> <some.c>
> int foo(int bar)
> {
> 	return baz;
> }
>
> Could coccinelle output:
>
> diff a/some.h b/some.h
> []
> -int foo(int);
> +int foo(int bar);

The following seems to work:

@r@
identifier f;
position p;
type T, t;
parameter list[n] ps;
@@

T f@p(ps,t,...);

@s@
identifier r.f,x;
type r.T, r.t;
parameter list[r.n] ps;
@@

T f(ps,t x,...) { ... }

@@
identifier r.f, s.x;
position r.p;
type r.T, r.t;
parameter list[r.n] ps;
@@

T f@p(ps,t
+ x
  ,...);

After letting it run for a few minutes without making any effort to
include .h files, I get over 2700 changed lines.

julia

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/15] improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  [PATCH 14/15] irqchip/metag-ext: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
    Re: [PATCH 14/15] irqchip/metag-ext: improve function-level documentation James Hogan <james.hogan@imgtec.com> - 2016-10-01 22:40 +0200
    [tip:irq/urgent] irqchip/metag-ext: Improve function-level  documentation tip-bot for Julia Lawall <tipbot@zytor.com> - 2016-10-05 12:00 +0200
  [PATCH 06/15] mfd: tc3589x: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  [PATCH 10/15] clk: keystone: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  [PATCH 01/15] UBIFS: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  [PATCH 07/15] clk: sunxi: mod0: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
    Re: [PATCH 07/15] clk: sunxi: mod0: improve function-level  documentation Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-10-04 23:10 +0200
  [PATCH 11/15] kobject: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  [PATCH 12/15] clk: tegra: dfll: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  [PATCH 09/15] gma500: improve function-level documentation Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-01 22:10 +0200
  Re: [PATCH 00/15] improve function-level documentation Joe Perches <joe@perches.com> - 2016-10-01 22:30 +0200
    Re: [PATCH 00/15] improve function-level documentation Julia Lawall <julia.lawall@lip6.fr> - 2016-10-01 22:40 +0200
  Re: [PATCH 00/15] improve function-level documentation Daniel Vetter <daniel@ffwll.ch> - 2016-10-05 15:20 +0200
    kernel-doc-rst-lint (was: Re: [PATCH 00/15] improve function-level documentation) Jani Nikula <jani.nikula@linux.intel.com> - 2016-10-05 16:10 +0200
      Re: kernel-doc-rst-lint (was: Re: [PATCH 00/15] improve function-level documentation) Markus Heiser <markus.heiser@darmarit.de> - 2016-10-05 19:30 +0200
      Re: kernel-doc-rst-lint (was: Re: [PATCH 00/15] improve function-level  documentation) Julia Lawall <julia.lawall@lip6.fr> - 2016-10-05 22:30 +0200
    Re: [PATCH 00/15] improve function-level documentation Julia Lawall <julia.lawall@lip6.fr> - 2016-10-05 16:50 +0200

csiph-web