diff options
Diffstat (limited to 'python_modules/marshal.py')
-rw-r--r-- | python_modules/marshal.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python_modules/marshal.py b/python_modules/marshal.py index a82df981..5b4dfdd7 100644 --- a/python_modules/marshal.py +++ b/python_modules/marshal.py @@ -356,10 +356,12 @@ def write_message_marshaller(writer, message, is_server, private): for n in names: writer.assign("*%s_out" % n, "NULL") - src = RootMarshallingSource(None, message.c_type(), message.sizeof(), "msg") - src.reuse_scope = scope + # fix warnings about unused variables by not creating body if no members to parse + if any(x.is_fixed_nw_size() for x in message.members): + src = RootMarshallingSource(None, message.c_type(), message.sizeof(), "msg") + src.reuse_scope = scope - write_container_marshaller(writer, message, src) + write_container_marshaller(writer, message, src) writer.end_block() writer.newline() |