Commit 176b1cc4 authored by Jeroen Demeyer's avatar Jeroen Demeyer

C functions without args should be declared as f(void)

parent 5d3a1346
......@@ -3190,7 +3190,10 @@ class DefNode(FuncDefNode):
arg_code_list.append(arg_decl_code(self.star_arg))
if self.starstar_arg:
arg_code_list.append(arg_decl_code(self.starstar_arg))
arg_code = ', '.join(arg_code_list)
if arg_code_list:
arg_code = ', '.join(arg_code_list)
else:
arg_code = 'void' # No arguments
dc = self.return_type.declaration_code(self.entry.pyfunc_cname)
decls_code = code.globalstate['decls']
......
......@@ -139,6 +139,14 @@ cdef class ArgsKwargs(object):
"""
return args + tuple(sorted(kwargs.items()))
@staticmethod
def no_args():
"""
>>> ArgsKwargs().no_args()
OK!
"""
print("OK!")
class StaticmethodSubclass(staticmethod):
"""
......
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