Skip to contentSkip to conversation

clean: use f(void) instead of f() to declare a pointer to a function without arguments

PATCH New René Scharfe 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clean: use f(void) instead of f() to declare a pointer to a function without arguments

Explicitly state that menu_item functions like clean_cmd don't take any arguments by using void instead of an empty parameter list.

Found using gcc -Wstrict-prototypes.

---
 builtin/clean.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/clean.c +1 -1
index 1032563..3beeea6 100644
@@ -67,7 +67,7 @@ struct menu_item {
 	char hotkey;
 	const char *title;
 	int selected;
-	int (*fn)();
+	int (*fn)(void);
 };
 
 enum menu_stuff_type {
Signature · 1 line
2.1.0