summaryrefslogtreecommitdiffstats
path: root/python_modules/demarshal.py
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
commitd6f198b3f433100a7a212be03b059876ed33e598 (patch)
treea9bff167e51a22e150f935cf3addea2180da25d0 /python_modules/demarshal.py
parent11269608a77b22df32ac1760b1df261c2b407af7 (diff)
downloadspice-protocol-d6f198b3f433100a7a212be03b059876ed33e598.tar.gz
spice-protocol-d6f198b3f433100a7a212be03b059876ed33e598.tar.xz
spice-protocol-d6f198b3f433100a7a212be03b059876ed33e598.zip
codegen: avoid creating out if not used (fix gcc 4.6.0 warning)
Diffstat (limited to 'python_modules/demarshal.py')
-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)")