[PATCH libevdev 2/4] Shut up another warning

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 17 21:21:00 PDT 2014


Triggered with -O3

../libevdev/libevdev.c: In function ‘libevdev_get_event_value’:
../libevdev/libevdev.c:1112:6: warning: ‘value’ may be used uninitialized in
this function [-Wmaybe-uninitialized]

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

diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
index b73c5f0..fe014d9 100644
--- a/libevdev/libevdev.c
+++ b/libevdev/libevdev.c
@@ -1109,7 +1109,7 @@ libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned
 LIBEVDEV_EXPORT int
 libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsigned int code)
 {
-	int value;
+	int value = 0;
 
 	if (!libevdev_has_event_type(dev, type) || !libevdev_has_event_code(dev, type, code))
 		return 0;
-- 
1.8.5.3



More information about the Input-tools mailing list