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/os/signal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/os/signal.c') diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index c7b4f86d6f..65657fda9c 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -26,7 +26,7 @@ static bool rejecting_deadly; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/signal.c.generated.h" #endif -void signal_init() +void signal_init(void) { uv_signal_init(uv_default_loop(), &sint); uv_signal_init(uv_default_loop(), &spipe); @@ -46,7 +46,7 @@ void signal_init() #endif } -void signal_stop() +void signal_stop(void) { uv_signal_stop(&sint); uv_signal_stop(&spipe); @@ -59,12 +59,12 @@ void signal_stop() #endif } -void signal_reject_deadly() +void signal_reject_deadly(void) { rejecting_deadly = true; } -void signal_accept_deadly() +void signal_accept_deadly(void) { rejecting_deadly = false; } -- cgit