mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 17:06:30 +00:00
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:

committed by
Nicolas Hillegeer

parent
2dc69700ec
commit
47084ea765
@@ -16,7 +16,7 @@ static uv_cond_t delay_cond;
|
||||
# include "os/time.c.generated.h"
|
||||
#endif
|
||||
/// Initializes the time module
|
||||
void time_init()
|
||||
void time_init(void)
|
||||
{
|
||||
uv_mutex_init(&delay_mutex);
|
||||
uv_cond_init(&delay_cond);
|
||||
|
Reference in New Issue
Block a user