Commit 7fa5990c authored by Stefan Behnel's avatar Stefan Behnel

silence a C compiler warning for trivial generators that do not use their...

silence a C compiler warning for trivial generators that do not use their closure class cast (seems to be difficult to avoid such cases)
parent 5e7c718a
...@@ -4095,6 +4095,9 @@ class GeneratorBodyDefNode(DefNode): ...@@ -4095,6 +4095,9 @@ class GeneratorBodyDefNode(DefNode):
lenv.scope_class.type.declaration_code(Naming.cur_scope_cname), lenv.scope_class.type.declaration_code(Naming.cur_scope_cname),
lenv.scope_class.type.cast_code('%s->closure' % lenv.scope_class.type.cast_code('%s->closure' %
Naming.generator_cname))) Naming.generator_cname)))
# FIXME: this silences a potential "unused" warning => try to avoid unused closures in more cases
code.putln("if (1); else %s = %s;" % (
Naming.cur_scope_cname, Naming.cur_scope_cname))
code.mark_pos(self.pos) code.mark_pos(self.pos)
code.putln("") code.putln("")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment