From 7d070ca0bad5dd9607dd7a3f92b4ea4dfe3c3162 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 23 Nov 2018 14:02:07 +0200 Subject: [PATCH] Fix compiler warnings generated by older toolchains/compiler This fixes warnings like ``may be used uninitialized'' libweston/compositor-drm.c: In function 'drm_device_is_kms': libweston/compositor-drm.c:6374:12: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized] b->drm.id = id; Signed-off-by: Marius Vlad --- clients/terminal.c | 2 +- libweston/compositor-drm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/terminal.c b/clients/terminal.c index f792badc..ebc5bbe2 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -2610,7 +2610,7 @@ recompute_selection(struct terminal *terminal) int side_margin, top_margin; int start_x, end_x; int cw, ch; - union utf8_char *data; + union utf8_char *data = NULL; cw = terminal->average_width; ch = terminal->extents.height; diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index b1be4922..91031c8c 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -6680,7 +6680,7 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device) const char *filename = udev_device_get_devnode(device); const char *sysnum = udev_device_get_sysnum(device); drmModeRes *res; - int id, fd; + int id = -1, fd; if (!filename) return false;