From 7df4e8635e21adb9e3e08444e07d776dc958c33d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 26 Jan 2018 14:29:09 +1300 Subject: Add length to arrays To satisfy -Wall, -Wpedantic --- funcptr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/funcptr.c b/funcptr.c index 33d4154..dc4aaf3 100644 --- a/funcptr.c +++ b/funcptr.c @@ -4,7 +4,7 @@ int doub(int); int trip(int); int half(int); -static int (*fpv[])(int); +static int (*fpv[4])(int); void fpv_exec(int (**)(int), int); int doub(int i) { @@ -19,7 +19,7 @@ int half(int i) { return i / 2; } -static int (*fpv[])(int) = {doub, trip, half, NULL}; +static int (*fpv[4])(int) = {doub, trip, half, NULL}; void fpv_exec(int (**fpv)(int), int n) { while (*fpv) -- cgit v1.2.3