lkml.org 
[lkml]   [2018]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] docs: kernel-doc: fix parsing of function pointers
On Mon, 3 Sep 2018 22:29:00 +0200
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> >> # pointer-to-function
> >> $arg =~ tr/#/,/;
> >> - $arg =~ m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/;
>
> m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/;
> ^
> Here we allow for 0..1 asterixes.
>
> If there is no asterix it is not a function pointer. Why should we care
> for this case?

GCC seems to allow that asterisk (asterix is an indomitable Gaul :) to be
missing; not sure if that's officially allowed by the language or not. I
also don't know if any code in the kernel elides it, but *somebody* at
some point made it optional, presumably with some reason. It would be
instructive to take out that "?" and see what changes happen in a docs
build; I'll try to find a moment to do that.

jon

\
 
 \ /
  Last update: 2018-09-03 23:38    [W:6.079 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site