summaryrefslogtreecommitdiffstats
path: root/python_modules
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-01-24 22:07:55 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:50 +0100
commit67ace54dbc64e5080d1b71d701993a3744948e1f (patch)
tree5228bb3f74e78662cbb5fc4699dcd650258d3fc7 /python_modules
parent248c08768d896abde1bdb66b4527f0ea7409ef64 (diff)
downloadspice-common-67ace54dbc64e5080d1b71d701993a3744948e1f.tar.gz
spice-common-67ace54dbc64e5080d1b71d701993a3744948e1f.tar.xz
spice-common-67ace54dbc64e5080d1b71d701993a3744948e1f.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.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index cbe3599..48551c0 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)")