scripts: gen_syscalls: declare syscalls with void instead of zero args

In C, `void foo(void);` and `void foo();` mean subtly different things.
The former means "foo takes zero arguments"; the latter means
"foo takes an unspecified number of arguments". This can result in
calling convention mismatches in exceptional cases.

Change to emitting `(void)` instead of `()` for a syscall with
zero arguments.

Signed-off-by: James Harris <james.harris@intel.com>
This commit is contained in:
James Harris 2021-03-04 08:21:14 -08:00 committed by Anas Nashif
parent 1337f7fe24
commit 074dbb9982
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ def wrapper_defs(func_name, func_type, args):
if ret64:
mrsh_args.append("(uintptr_t)&ret64")
decl_arglist = ", ".join([" ".join(argrec) for argrec in args])
decl_arglist = ", ".join([" ".join(argrec) for argrec in args]) or "void"
wrap = "extern %s z_impl_%s(%s);\n" % (func_type, func_name, decl_arglist)
wrap += "static inline %s %s(%s)\n" % (func_type, func_name, decl_arglist)