else:
self.putln("%s%s;" % (static and "static " or "", decl))
+ if func_context.should_declare_error_indicator:
+ # Initialize these variables to silence compiler warnings
+ self.putln("int %s = 0;" % Naming.lineno_cname)
+ self.putln("const char *%s = NULL;" % Naming.filename_cname)
+ self.putln("int %s = 0;" % Naming.clineno_cname)
+
def put_h_guard(self, guard):
self.putln("#ifndef %s" % guard)
self.putln("#define %s" % guard)
# ----- Go back and insert temp variable declarations
tempvardecl_code.put_temp_declarations(code.funcstate)
- if code.funcstate.should_declare_error_indicator:
- # Initialize these variables to silence compiler warnings
- tempvardecl_code.putln("int %s = 0;" % Naming.lineno_cname)
- tempvardecl_code.putln("const char *%s = NULL;" %
- Naming.filename_cname)
- if code.c_line_in_traceback:
- tempvardecl_code.putln("int %s = 0;" % Naming.clineno_cname)
# ----- Python version
code.exit_cfunc_scope()