Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2008902imm; Mon, 3 Sep 2018 15:56:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbCRQPXZWaVOVQFVeHZ01ykvyvNpW3txvC9N6B0KARZWIhwTq9jlT9vKu6Wf39Ig5uyITDZ X-Received: by 2002:a62:e11:: with SMTP id w17-v6mr32069168pfi.242.1536015408574; Mon, 03 Sep 2018 15:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536015408; cv=none; d=google.com; s=arc-20160816; b=CGXQVnmjGEvYGPw+8LCtwOyF1UX4ilmlvoM5k1A8B9gin0TXDwXodtHgF7fa9SreqY 4Erur1AzZl/AF5bWdAxzpgoPvHS1HCaCukiExH0mDp7g501PuuGI3amuljQLlfsIf4Ih Gn6iVLbHmY5BqAN2F6h0pAApv33ITzXVEJL+evC9Wd718ToPgRTx+l+DekeZuF/ZSabU 50rgWUU9fw9jfnI7sYn30IHdrFtDKdPsAW0ReN8hkG6LVSlJRG8DNYMGnkAiSGUTDoxq ST/I82JsV7Gxi/c0KqoWfEzfzKBKeebAQ2qWmMEDyCs40JT4d+3/836LudiC48GAF43k 5pQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=kfoA3rP9gBuf8FYbDkqqZmgOptTWjZnV60zk0WYy43I=; b=ogot+yG/vIieRPCR2n0nluQQCTaepnP/7Vopnn1ZunHcmOkObZ4rVkorOvjkm3U+hE DMKsU8egcpXMQV0vWAKxUSPvC/qaSm8iogcv9qudTQ+Qbk5jIi0LThSP1U9KlTz0Cj+U MrRQ9Gm7OC/kYm0oEJQxwY6UbFbA9WUCdjct3sXDu8nQaQk0CPtqyDbiAokT5foqar7v TdRKmOD7qtvvmxbcM1w9fje+gGxxSlf1A9lJrP+bB7a+eQnu/q5V4TDbyJEPZt6PG2Wv WCXZpltBgrQ6HutRajU9dLmYe8AxEBxfPqYf4feyCuU4cRiknPxWij59jfJ53hniLgoQ dKuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13-v6si19031189pll.337.2018.09.03.15.56.31; Mon, 03 Sep 2018 15:56:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726347AbeIDDRi (ORCPT + 99 others); Mon, 3 Sep 2018 23:17:38 -0400 Received: from esgaroth.petrovitsch.at ([78.47.184.11]:4036 "EHLO esgaroth.tuxoid.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbeIDDRi (ORCPT ); Mon, 3 Sep 2018 23:17:38 -0400 Received: from thorin.petrovitsch.priv.at (80-110-72-12.cgn.dynamic.surfer.at [80.110.72.12]) (authenticated bits=0) by esgaroth.tuxoid.at (8.15.2/8.15.2) with ESMTPSA id w83Msg7I015093 (version=TLSv1 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 4 Sep 2018 00:54:45 +0200 Subject: Re: [PATCH 1/1] docs: kernel-doc: fix parsing of function pointers To: Joe Perches , Jonathan Corbet , Heinrich Schuchardt Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180903184153.9368-1-xypron.glpk@gmx.de> <20180903130043.059b2e82@lwn.net> <20180903153804.2b091448@lwn.net> <6cfb25aff666e58a376303ce02de8caa481a6599.camel@perches.com> From: Bernd Petrovitsch Message-ID: <9bd050f6-eba1-a15c-3d42-948975be484b@petrovitsch.priv.at> Date: Tue, 4 Sep 2018 00:54:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <6cfb25aff666e58a376303ce02de8caa481a6599.camel@perches.com> Content-Type: multipart/mixed; boundary="------------F3433EB4A65D027C26E67B8D" Content-Language: en-US X-DCC-MGTINTERNET-Metrics: esgaroth.tuxoid.at 1170; Body=5 Fuz1=5 Fuz2=5 X-Virus-Scanned: clamav-milter 0.97 at esgaroth.tuxoid.at X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Report: * 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on esgaroth.tuxoid.at Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------F3433EB4A65D027C26E67B8D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/09/18 00:28, Joe Perches wrote: > On Mon, 2018-09-03 at 15:38 -0600, Jonathan Corbet wrote: >> On Mon, 3 Sep 2018 22:29:00 +0200 >> Heinrich Schuchardt wrote: >> >>>>> # pointer-to-function >>>>> $arg =3D~ tr/#/,/; >>>>> - $arg =3D~ m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/; =20 >>> >>> m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/; >>> ^ >>> Here we allow for 0..1 asterixes. What's with pointers to function pointers and/or function pointer arrays? ;-) >>> If there is no asterix it is not a function pointer. Why should we ca= re >>> for this case? >> >> GCC seems to allow that asterisk (asterix is an indomitable Gaul :) to= be *g* >> 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, >=20 > Many typedefs for function pointers do not use the * > Dunno if there are many others, I didn't look hard. ---- snip ---- typedef void (*foo)(int); ---- snip ---- is a function pointer type (and nothing else;-) and can be used to declare and/or define a pointer to a function as in ---- snip ---- foo ptr_to_func_with_int_param_and_no_result; ---- snip ---- ---- snip ---- typedef void bar(int); ---- snip ---- is a function type and can be used for function prototypes as in ---- snip ---- bar func_with_int_param_and_no_result; ---- snip ---- and/or function pointers as in ---- snip ---- bar *also_ptr_to_func_with_int_param_and_no_result; ---- snip ---- Both of work (in functions) as ---- snip ---- ptr_to_func_with_int_param_and_no_result =3D &func_with_int_param_and_no_result; ptr_to_func_with_int_param_and_no_result =3D func_with_int_param_and_no_result; also_ptr_to_func_with_int_param_and_no_result =3D &func_with_int_param_and_no_result; also_ptr_to_func_with_int_param_and_no_result =3D func_with_int_param_and_no_result; ---- snip ---- Note the missing "()" in both cases (otherwise it would be a function call - possibly returning the function pointers). I don't know if there is a preferred style in the kernel though. MfG, Bernd --=20 Bernd Petrovitsch Email : bernd@petrovitsch.priv.at LUGA : http://www.luga.at --------------F3433EB4A65D027C26E67B8D Content-Type: application/pgp-keys; name="pEpkey.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pEpkey.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- mQENBFr26nABCAC94WhTqVPMksk/AErK3NqDKXE0sqO5umWIF3f4DYRidk8SIuNq Fk3Sc8hqE2HlbCB9lxV9q+eqDQ8bRjMF6ud7rjXortlwmoclRRMUuSJhluKo0C7o y2fJIwlQAcAKWNfOKqZBTTz81Mntb4j26MsSL7t7JIibst/G7EfoqyB9CkeoI8R2 20WVKV7Cb70G5cYZkLrSdjhSZ8FJn0QTb+r/TTYHRCFvU2sv+wvG3LAdWfHVnyaC l9rPkglsYXFCtsdx3jW2zvWf+mGEjpANlVc/9M621C/uS7viLzalmFENpgM1UqFx TEEt8mwepc7dkiiKlslmDGUWSfc/BAcln8BjABEBAAG0LUJlcm5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Zq+2FKr6niNllxKGWUhz EOYtHE71Xm95LPjVi+ETzONF9Xt1ibjFahioSgx8ld/OrsUKv2nVmWVrHErQ+Ed0 m2fhBB0V9hhv7oCiKv0dfDeoPmeQWmiwMEqBYMgMMaJBUBs4pVwrHYVYYvWGLTfV uyqqdpcKo99ns7ALSI7PGCwM4J9ra77L8PQenc329eEREzhC0Ok/Qgk+rI832lD7 bxT8MO4=3D =3DpFcw -----END PGP PUBLIC KEY BLOCK----- --------------F3433EB4A65D027C26E67B8D--