diff options
| author | Alon Levy <alevy@redhat.com> | 2011-01-24 22:07:55 +0200 |
|---|---|---|
| committer | Alon Levy <alevy@redhat.com> | 2011-01-25 17:29:31 +0200 |
| commit | 00f2d2782863a1ddd951e04931e72ef1dbef2cca (patch) | |
| tree | fd849dd63d06e1fa549c2b71b7f6ad8fbd7fcce4 /python_modules | |
| parent | d20c90c7ef00c36bd5737dcb27da21d43e2f7c9c (diff) | |
| download | spice-00f2d2782863a1ddd951e04931e72ef1dbef2cca.tar.gz spice-00f2d2782863a1ddd951e04931e72ef1dbef2cca.tar.xz spice-00f2d2782863a1ddd951e04931e72ef1dbef2cca.zip | |
codegen: avoid creating out if not used (fix gcc 4.6.0 warning)
Diffstat (limited to 'python_modules')
| -rw-r--r-- | python_modules/demarshal.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py index cbe3599d..48551c07 100644 --- a/python_modules/demarshal.py +++ b/python_modules/demarshal.py @@ -1047,9 +1047,11 @@ def write_msg_parser(writer, message): writer.assign("end", "data + %s" % (msg_sizeof)) writer.assign("in", "start").newline() - dest = RootDemarshallingDestination(None, msg_type, msg_sizeof, "data") - dest.reuse_scope = parent_scope - write_container_parser(writer, message, dest) + # avoid defined and assigned but not used warnings of gcc 4.6.0+ + if message.is_extra_size() or not message.is_fixed_nw_size() or message.get_fixed_nw_size() > 0: + dest = RootDemarshallingDestination(None, msg_type, msg_sizeof, "data") + dest.reuse_scope = parent_scope + write_container_parser(writer, message, dest) writer.newline() writer.statement("assert(in <= message_end)") |
