From 47084ea7657121837536d409b9137fd38426aeef Mon Sep 17 00:00:00 2001 From: Pavel Platto Date: Sun, 13 Jul 2014 10:03:07 +0300 Subject: Use strict function prototypes #945 `-Wstrict-prototypes` warn if a function is declared or defined without specifying the argument types. This warning disallow function prototypes with empty parameter list. In C, a function declared with an empty parameter list accepts an arbitrary number of arguments when being called. This is for historic reasons; originally, C functions didn't have prototypes, as C evolved from B, a typeless language. When prototypes were added, the original typeless declarations were left in the language for backwards compatibility. Instead we should provide `void` in argument list to state that function doesn't have arguments. Also this warning disallow declaring type of the parameters after the parentheses because Neovim header generator produce no declarations for old-stlyle prototypes: it expects to find `{` after prototype. --- src/nvim/ex_getln.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/nvim/ex_getln.c') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index ad0bcdc150..e8e2f61679 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -3932,11 +3932,8 @@ expand_shellcmd ( * Call "user_expand_func()" to invoke a user defined VimL function and return * the result (either a string or a List). */ -static void * call_user_expand_func(user_expand_func, xp, num_file, file) -user_expand_func_T user_expand_func; -expand_T *xp; -int *num_file; -char_u ***file; +static void * call_user_expand_func(user_expand_func_T user_expand_func, + expand_T *xp, int *num_file, char_u ***file) { int keep = 0; char_u num[50]; -- cgit