In case we need to use QAPI types but no QAPI command / QAPI event actually use them, the generated qmp_marshal_output() function will trigger the compiler 'unused-function' warnings. To prevent that, emit these functions inlined: the compiler will ignore such unused functions.
Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> --- RFC: No clue about QAPI... Tested with GCC. If the compiler is picky we could use the 'unused' function attribute. --- scripts/qapi/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 0e13d510547..bbed776a909 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -91,8 +91,8 @@ def gen_call(name: str, def gen_marshal_output(ret_type: QAPISchemaType) -> str: return mcgen(''' -static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, - QObject **ret_out, Error **errp) +static inline void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, + QObject **ret_out, Error **errp) { Visitor *v; -- 2.31.1