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.
This commit is contained in:
Pavel Platto
2014-07-13 10:03:07 +03:00
committed by Nicolas Hillegeer
parent 2dc69700ec
commit 47084ea765
24 changed files with 115 additions and 126 deletions

View File

@@ -639,7 +639,7 @@ void update_single_line(win_T *wp, linenr_T lnum)
* Prepare for updating one or more windows.
* Caller must check for "updating_screen" already set to avoid recursiveness.
*/
static void update_prepare()
static void update_prepare(void)
{
cursor_off();
updating_screen = TRUE;
@@ -649,7 +649,7 @@ static void update_prepare()
/*
* Finish updating one or more windows.
*/
static void update_finish()
static void update_finish(void)
{
if (redraw_cmdline) {
showmode();