From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
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: Fri, 30 Oct 2020 17:49:33 +0000 [thread overview]
Message-ID: <20201030174933.GH104289@redhat.com> (raw)
In-Reply-To: <20201030174700.7204-2-peter.maydell@linaro.org>
On Fri, Oct 30, 2020 at 05:46:59PM +0000, Peter Maydell 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(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-10-30 17:51 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é [this message]
2020-11-02 11:24 ` Stefan Hajnoczi
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=20201030174933.GH104289@redhat.com \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.