From: Stefan Hajnoczi <stefanha@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH 1/2] scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments
Date: Mon, 2 Nov 2020 11:24:02 +0000 [thread overview]
Message-ID: <CAJSP0QWTwUW5HrtczzT0G_i5HCxHbzMOiQ7jUnf8-9MNf_wf0Q@mail.gmail.com> (raw)
In-Reply-To: <20201030174700.7204-2-peter.maydell@linaro.org>
On Fri, Oct 30, 2020 at 5:47 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> The kerneldoc script currently emits Sphinx markup for a macro with
> arguments that uses the c:function directive. This is correct for
> Sphinx versions earlier than Sphinx 3, where c:macro doesn't allow
> documentation of macros with arguments and c:function is not picky
> about the syntax of what it is passed. However, in Sphinx 3 the
> c:macro directive was enhanced to support macros with arguments,
> and c:function was made more picky about what syntax it accepted.
>
> When kerneldoc is told that it needs to produce output for Sphinx
> 3 or later, make it emit c:function only for functions and c:macro
> for macros with arguments. We assume that anything with a return
> type is a function and anything without is a macro.
>
> This fixes the Sphinx error:
>
> /home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/qom/object.h:155:Error in declarator
> If declarator-id with parameters (e.g., 'void f(int arg)'):
> Invalid C declaration: Expected identifier in nested name. [error at 25]
> DECLARE_INSTANCE_CHECKER ( InstanceType, OBJ_NAME, TYPENAME)
> -------------------------^
> If parenthesis in noptr-declarator (e.g., 'void (*f(int arg))(double)'):
> Error in declarator or parameters
> Invalid C declaration: Expecting "(" in parameters. [error at 39]
> DECLARE_INSTANCE_CHECKER ( InstanceType, OBJ_NAME, TYPENAME)
> ---------------------------------------^
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> scripts/kernel-doc | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
Tested-by: Stefan Hajnoczi <stefanha@redhat.com>
next prev parent reply other threads:[~2020-11-02 11:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 17:46 [PATCH 0/2] docs: Fix building with Sphinx 3.2 Peter Maydell
2020-10-30 17:46 ` [PATCH 1/2] scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments Peter Maydell
2020-10-30 17:49 ` Daniel P. Berrangé
2020-11-02 11:24 ` Stefan Hajnoczi [this message]
2020-10-30 17:47 ` [PATCH 2/2] qemu-option-trace.rst.inc: Don't use option:: markup Peter Maydell
2020-10-30 17:48 ` Daniel P. Berrangé
2020-11-02 11:22 ` Stefan Hajnoczi
2020-10-30 18:20 ` [PATCH 0/2] docs: Fix building with Sphinx 3.2 Paolo Bonzini
2020-10-30 19:12 ` Peter Maydell
2020-10-30 20:02 ` Peter Maydell
2020-10-31 14:58 ` Paolo Bonzini
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=CAJSP0QWTwUW5HrtczzT0G_i5HCxHbzMOiQ7jUnf8-9MNf_wf0Q@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).