92bb29f9b2
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> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20201030174700.7204-2-peter.maydell@linaro.org |
||
---|---|---|
.. | ||
ci | ||
coccinelle | ||
codeconverter | ||
coverity-scan | ||
kvm | ||
modules | ||
oss-fuzz | ||
performance | ||
qapi | ||
qemu-guest-agent | ||
qemugdb | ||
qmp | ||
simplebench | ||
tracetool | ||
travis | ||
analyse-9p-simpletrace.py | ||
analyse-locks-simpletrace.py | ||
analyze-inclusions | ||
analyze-migration.py | ||
archive-source.sh | ||
block-coroutine-wrapper.py | ||
check_sparse.py | ||
checkpatch.pl | ||
clean-header-guards.pl | ||
clean-includes | ||
cleanup-trace-events.pl | ||
cocci-macro-file.h | ||
coverity-model.c | ||
decodetree.py | ||
device-crash-test | ||
disas-objdump.pl | ||
dump-guest-memory.py | ||
extract-vsssdk-headers | ||
feature_to_c.sh | ||
fix-multiline-comments.sh | ||
gensyscalls.sh | ||
get_maintainer.pl | ||
git-submodule.sh | ||
git.orderfile | ||
hxtool | ||
hxtool-conv.pl | ||
kernel-doc | ||
make-release | ||
meson.build | ||
minikconf.py | ||
mtest2make.py | ||
nsis.py | ||
qapi-gen.py | ||
qemu-binfmt-conf.sh | ||
qemu-gdb.py | ||
qemu-trace-stap | ||
qemu-version.sh | ||
refresh-pxe-roms.sh | ||
render_block_graph.py | ||
replay-dump.py | ||
shaderinclude.pl | ||
show-fixed-bugs.sh | ||
signrom.py | ||
simpletrace.py | ||
switch-timer-api | ||
tap-driver.pl | ||
tap-merge.pl | ||
test-driver.py | ||
tracetool.py | ||
u2f-setup-gen.py | ||
undefsym.py | ||
update-linux-headers.sh | ||
update-mips-syscall-args.sh | ||
update-syscalltbl.sh | ||
vmstate-static-checker.py |