| From 876c6ff1e20f51b0921acda99861f476b6423f26 Mon Sep 17 00:00:00 2001 |
| From: Hongxu Jia <hongxu.jia@windriver.com> |
| Date: Mon, 11 Aug 2014 12:39:53 +0800 |
| Subject: [PATCH] gtk.c: fix compiling failure with option -g -O |
| |
| There were compiling failure with option -g -O |
| ... |
| ././gtk.c: In function 'configure_area': |
| ././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| cairo_set_source_rgb(cr, |
| ^ |
| ././gtk.c:384:14: note: 'cr' was declared here |
| cairo_t *cr; |
| ^ |
| ././gtk.c: In function 'main': |
| ././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| fprintf(stderr, "%s: %s\n", pname, error); |
| ^ |
| cc1: all warnings being treated as errors |
| ... |
| |
| Initialized pointer 'cr' and 'error' with NULL |
| |
| Upstream-Status: Pending |
| |
| Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| |
| --- |
| gtk.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/gtk.c b/gtk.c |
| index 4565836..5e83b48 100644 |
| --- a/gtk.c |
| +++ b/gtk.c |
| @@ -2944,7 +2944,7 @@ static void list_presets_from_menu(struct preset_menu *menu) |
| int main(int argc, char **argv) |
| { |
| char *pname = argv[0]; |
| - char *error; |
| + char *error = NULL; |
| int ngenerate = 0, px = 1, py = 1; |
| bool print = false; |
| bool time_generation = false, test_solve = false, list_presets = false; |