Commit d5a5efb1 authored by Robert Bradshaw's avatar Robert Bradshaw

Suppress self-assignment warning.

parent db9591ab
......@@ -4089,8 +4089,7 @@ class GeneratorBodyDefNode(DefNode):
lenv.scope_class.type.cast_code('%s->closure' %
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.putln("CYTHON_MAYBE_UNUSED_VAR(%s);" % Naming.cur_scope_cname)
code.mark_pos(self.pos)
code.putln("")
......
......@@ -399,6 +399,14 @@
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
# if defined(__cplusplus)
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
# define CYTHON_NCP_UNUSED
......
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