threads / patch / 37358

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

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

## tl;dr

One message between Aug 16, 2014 and Aug 16, 2014. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

René Scharfe· Aug 16, 2014, 11:16 UTC · lore

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.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 builtin/clean.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to builtin/clean.c +1 −1
diff --git a/builtin/clean.c b/builtin/clean.c
index 1032563..3beeea6 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -67,7 +67,7 @@ struct menu_item {
 	char hotkey;
 	const char *title;
 	int selected;
-	int (*fn)();
+	int (*fn)(void);
 };
 
 enum menu_stuff_type {
-- 
2.1.0

← back to recent threads