blob: 28040523d4fd704d44cff0b0cff6a7874a318c97 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001From 876c6ff1e20f51b0921acda99861f476b6423f26 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Mon, 11 Aug 2014 12:39:53 +0800
4Subject: [PATCH] gtk.c: fix compiling failure with option -g -O
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005
6There were compiling failure with option -g -O
7...
8././gtk.c: In function 'configure_area':
9././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
10 cairo_set_source_rgb(cr,
11 ^
12././gtk.c:384:14: note: 'cr' was declared here
13 cairo_t *cr;
14 ^
15././gtk.c: In function 'main':
16././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
17 fprintf(stderr, "%s: %s\n", pname, error);
18 ^
19cc1: all warnings being treated as errors
20...
21
22Initialized pointer 'cr' and 'error' with NULL
23
24Upstream-Status: Pending
25
26Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028---
Andrew Geissler82c905d2020-04-13 13:39:40 -050029 gtk.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031
32diff --git a/gtk.c b/gtk.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050033index 4565836..5e83b48 100644
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034--- a/gtk.c
35+++ b/gtk.c
Andrew Geissler82c905d2020-04-13 13:39:40 -050036@@ -2944,7 +2944,7 @@ static void list_presets_from_menu(struct preset_menu *menu)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037 int main(int argc, char **argv)
38 {
39 char *pname = argv[0];
40- char *error;
41+ char *error = NULL;
Andrew Geissler82c905d2020-04-13 13:39:40 -050042 int ngenerate = 0, px = 1, py = 1;
43 bool print = false;
44 bool time_generation = false, test_solve = false, list_presets = false;