From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout.scc.kit.edu (mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s9DDSIRP009498 for ; Mon, 13 Oct 2014 09:28:18 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1Xdffb-0004lD-Lb; Mon, 13 Oct 2014 15:28:15 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1Xdffb-0005Uz-IB for discuss@mdocml.bsd.lv; Mon, 13 Oct 2014 15:28:15 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1Xdffb-0005NJ-Gr for discuss@mdocml.bsd.lv; Mon, 13 Oct 2014 15:28:15 +0200 Received: from schwarze by usta.de with local (Exim 4.77) (envelope-from ) id 1Xdfer-0003jI-PI for discuss@mdocml.bsd.lv; Mon, 13 Oct 2014 15:27:29 +0200 Date: Mon, 13 Oct 2014 15:27:29 +0200 From: Ingo Schwarze To: discuss@mdocml.bsd.lv Subject: Re: Feature request for -Tlint Message-ID: <20141013132729.GH31838@iris.usta.de> References: <2040.1412894767@cathet.us> <20141011212541.GZ30780@iris.usta.de> <25656.1413103480@cathet.us> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25656.1413103480@cathet.us> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Anthony, Anthony J. Bentley wrote on Sun, Oct 12, 2014 at 02:44:40AM -0600: > Ingo Schwarze writes: >> Anthony J. Bentley wrote: >>> Of course, parentheses are allowed in arguments besides the first >>> argument, but I can't think of any case where they're needed in >>> the first one. >> Me neither, so i have committed the following patch. > Thanks for implementing this. There are some cases (common in the > LibreSSL manuals) that are false positives: > > SSL_CTX_set_info_callback(3): > .Fn "(*SSL_CTX_get_info_callback(const SSL_CTX *ctx))" > > SSL_CTX_set_client_cert_cb(3): > .Fn "(*client_cert_cb)" "SSL *ssl" "X509 **x509" "EVP_PKEY **pkey" Gah, functions returning function pointers. Another terrible example is signal(3). > Based on this I would suggest the warning only pick up trailing (), > not just any parentheses in the first argument. Another idea: If the first parenthesis is '(' and if it's followed by '*', it looks like a callback and is probably OK. I guess i'll implement that. > Of course, if there's a better way to mark these up, I'd like > to know... There is no really good way. To insert the initial "(*", prefexing .Fo or .Fn doesn't help because that would end up before the line break, and there is no way to semantically prefix an argument. Likewise for the end: Putting something after .Fc or .Fn ends up after the trailing semicolon, and there is no way to semantically postfix an .Fa macro or an .Fn argument. So some physical trickery is required. The best i managed to come up with, in the sense of getting correct output, putting all alphanumeric parts below the correct macros, and minimizing physical formatting, looks like this: .Ft void .Fn \fR(*\fPSSL_CTX_get_info_callback "const SSL_CTX *ctx\fR))(\fP" Sure, the "\fR(*\fP" and "\fR))(\fP" don't really belong inside the .Fn arguments, but i see no other place to put them. Yours, Ingo -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv