diff options
author | Pavel Platto <hinidu@gmail.com> | 2014-07-13 10:03:07 +0300 |
---|---|---|
committer | Nicolas Hillegeer <nicolas@hillegeer.com> | 2014-07-14 20:28:40 +0200 |
commit | 47084ea7657121837536d409b9137fd38426aeef (patch) | |
tree | 1bf014cf8e25a6875bc49328deafbfc9f5e0ef88 /src/nvim/os_unix_defs.h | |
parent | 2dc69700ec9a01b3b7cd4823e8cd3ad5431b9410 (diff) | |
download | rneovim-47084ea7657121837536d409b9137fd38426aeef.tar.gz rneovim-47084ea7657121837536d409b9137fd38426aeef.tar.bz2 rneovim-47084ea7657121837536d409b9137fd38426aeef.zip |
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.
Diffstat (limited to 'src/nvim/os_unix_defs.h')
-rw-r--r-- | src/nvim/os_unix_defs.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/os_unix_defs.h b/src/nvim/os_unix_defs.h index 6a3934b0c8..5ba9d2d98d 100644 --- a/src/nvim/os_unix_defs.h +++ b/src/nvim/os_unix_defs.h @@ -41,17 +41,14 @@ #ifdef SIGHASARG # ifdef SIGHAS3ARGS -# define SIGPROTOARG (int, int, struct sigcontext *) -# define SIGDEFARG(s) (s, sig2, scont) int s, sig2; struct sigcontext *scont; +# define SIGDEFARG(s) (int s, int sig2, struct sigcontext *scont) # define SIGDUMMYARG 0, 0, (struct sigcontext *)0 # else -# define SIGPROTOARG (int) -# define SIGDEFARG(s) (s) int s; +# define SIGDEFARG(s) (int s) # define SIGDUMMYARG 0 # endif #else -# define SIGPROTOARG (void) -# define SIGDEFARG(s) () +# define SIGDEFARG(s) (void) # define SIGDUMMYARG #endif |