Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | From 876c6ff1e20f51b0921acda99861f476b6423f26 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Mon, 11 Aug 2014 12:39:53 +0800 |
| 4 | Subject: [PATCH] gtk.c: fix compiling failure with option -g -O |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | |
| 6 | There 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 | ^ |
| 19 | cc1: all warnings being treated as errors |
| 20 | ... |
| 21 | |
| 22 | Initialized pointer 'cr' and 'error' with NULL |
| 23 | |
| 24 | Upstream-Status: Pending |
| 25 | |
| 26 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | --- |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 29 | gtk.c | 2 +- |
| 30 | 1 file changed, 1 insertion(+), 1 deletion(-) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | |
| 32 | diff --git a/gtk.c b/gtk.c |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 33 | index 4565836..5e83b48 100644 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | --- a/gtk.c |
| 35 | +++ b/gtk.c |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 36 | @@ -2944,7 +2944,7 @@ static void list_presets_from_menu(struct preset_menu *menu) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | int main(int argc, char **argv) |
| 38 | { |
| 39 | char *pname = argv[0]; |
| 40 | - char *error; |
| 41 | + char *error = NULL; |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 42 | int ngenerate = 0, px = 1, py = 1; |
| 43 | bool print = false; |
| 44 | bool time_generation = false, test_solve = false, list_presets = false; |