[PATCH libinput 3/5] Fix va_start compiler warning

Peter Hutterer peter.hutterer at who-t.net
Wed May 10 03:47:58 UTC 2017


../src/libinput.c:56:17: warning: passing an object that undergoes default
argument promotion to 'va_start' has undefined behavior [-Wvarargs]

The enum's size is compiler-defined, so the enum gets promoted to whatever the
compiler chose. That promotion is undefined, so let's use an int here.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/libinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libinput.c b/src/libinput.c
index 472b1c0c..23255b07 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -46,7 +46,7 @@
 static inline bool
 check_event_type(struct libinput *libinput,
 		 const char *function_name,
-		 enum libinput_event_type type_in,
+		 unsigned int type_in,
 		 ...)
 {
 	bool rc = false;
-- 
2.12.2



More information about the wayland-devel mailing list