Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | gtk.c: fix compiling failure with option -g -O |
| 2 | |
| 3 | There were compiling failure with option -g -O |
| 4 | ... |
| 5 | ././gtk.c: In function 'configure_area': |
| 6 | ././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| 7 | cairo_set_source_rgb(cr, |
| 8 | ^ |
| 9 | ././gtk.c:384:14: note: 'cr' was declared here |
| 10 | cairo_t *cr; |
| 11 | ^ |
| 12 | ././gtk.c: In function 'main': |
| 13 | ././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
| 14 | fprintf(stderr, "%s: %s\n", pname, error); |
| 15 | ^ |
| 16 | cc1: all warnings being treated as errors |
| 17 | ... |
| 18 | |
| 19 | Initialized pointer 'cr' and 'error' with NULL |
| 20 | |
| 21 | Upstream-Status: Pending |
| 22 | |
| 23 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 24 | --- |
| 25 | gtk.c | 4 ++-- |
| 26 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 27 | |
| 28 | diff --git a/gtk.c b/gtk.c |
| 29 | index a2eba2c..c54bf63 100644 |
| 30 | --- a/gtk.c |
| 31 | +++ b/gtk.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | @@ -2481,7 +2481,7 @@ char *fgetline(FILE *fp) |
| 33 | int main(int argc, char **argv) |
| 34 | { |
| 35 | char *pname = argv[0]; |
| 36 | - char *error; |
| 37 | + char *error = NULL; |
| 38 | int ngenerate = 0, print = FALSE, px = 1, py = 1; |
| 39 | int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE; |
| 40 | int soln = FALSE, colour = FALSE; |
| 41 | -- |
| 42 | 1.9.1 |
| 43 | |