aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-08-12 17:25:37 -0700
committerPaul Eggert2018-08-12 17:25:54 -0700
commita1e0868f74f7b2b6b77026734102bd453cf1933b (patch)
tree82780ea818ce15827cd7d3669839606f9c54faf0 /src
parentca10011898e2ceeded4027413a1488837199ad7a (diff)
downloademacs-a1e0868f74f7b2b6b77026734102bd453cf1933b.tar.gz
emacs-a1e0868f74f7b2b6b77026734102bd453cf1933b.zip
Pacify gcc -Og -Wuninitialized
This addresses the -Og uninitialized variable warnings I ran into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5). It also changes some explicit initializations to UNINIT when the variable does not actually need to be initialized. * src/process.c (connect_network_socket): * src/sysdep.c (system_process_attributes): * src/xfns.c (x_real_pos_and_offsets): * src/xterm.c (get_current_wm_state) [USE_XCB]: Add UNINIT. * src/editfns.c (tzlookup): * src/fns.c (Fnconc): * src/font.c (font_parse_fcname): * src/frame.c (x_set_frame_parameters): Prefer UNINIT to explicit initialization.
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c2
-rw-r--r--src/fns.c2
-rw-r--r--src/font.c2
-rw-r--r--src/frame.c2
-rw-r--r--src/process.c2
-rw-r--r--src/sysdep.c2
-rw-r--r--src/xfns.c2
-rw-r--r--src/xterm.c2
8 files changed, 8 insertions, 8 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 71eb2a88090..d2281d7e81c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -174,7 +174,7 @@ tzlookup (Lisp_Object zone, bool settz)
174 else if (plain_integer || (CONSP (zone) && FIXNUMP (XCAR (zone)) 174 else if (plain_integer || (CONSP (zone) && FIXNUMP (XCAR (zone))
175 && CONSP (XCDR (zone)))) 175 && CONSP (XCDR (zone))))
176 { 176 {
177 Lisp_Object abbr = Qnil; 177 Lisp_Object abbr UNINIT;
178 if (!plain_integer) 178 if (!plain_integer)
179 { 179 {
180 abbr = XCAR (XCDR (zone)); 180 abbr = XCAR (XCDR (zone));
diff --git a/src/fns.c b/src/fns.c
index 7af2273f7e9..f6e68036413 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2522,7 +2522,7 @@ usage: (nconc &rest LISTS) */)
2522 2522
2523 CHECK_CONS (tem); 2523 CHECK_CONS (tem);
2524 2524
2525 Lisp_Object tail = Qnil; 2525 Lisp_Object tail UNINIT;
2526 FOR_EACH_TAIL (tem) 2526 FOR_EACH_TAIL (tem)
2527 tail = tem; 2527 tail = tem;
2528 2528
diff --git a/src/font.c b/src/font.c
index 9a0a9babd27..920ec1e02b1 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1468,7 +1468,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
1468 else 1468 else
1469 { 1469 {
1470 /* KEY=VAL pairs */ 1470 /* KEY=VAL pairs */
1471 Lisp_Object key = Qnil; 1471 Lisp_Object key UNINIT;
1472 int prop; 1472 int prop;
1473 1473
1474 if (q - p == 10 && memcmp (p + 1, "pixelsize", 9) == 0) 1474 if (q - p == 10 && memcmp (p + 1, "pixelsize", 9) == 0)
diff --git a/src/frame.c b/src/frame.c
index 81642ccded3..ece8971d5b6 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3798,7 +3798,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
3798 Lisp_Object icon_left, icon_top; 3798 Lisp_Object icon_left, icon_top;
3799 3799
3800 /* And with this. */ 3800 /* And with this. */
3801 Lisp_Object fullscreen = Qnil; 3801 Lisp_Object fullscreen UNINIT;
3802 bool fullscreen_change = false; 3802 bool fullscreen_change = false;
3803 3803
3804 /* Record in these vectors all the parms specified. */ 3804 /* Record in these vectors all the parms specified. */
diff --git a/src/process.c b/src/process.c
index c8123be28e8..a266da1c1b9 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3336,7 +3336,7 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
3336 int family; 3336 int family;
3337 struct sockaddr *sa = NULL; 3337 struct sockaddr *sa = NULL;
3338 int ret; 3338 int ret;
3339 ptrdiff_t addrlen; 3339 ptrdiff_t addrlen UNINIT;
3340 struct Lisp_Process *p = XPROCESS (proc); 3340 struct Lisp_Process *p = XPROCESS (proc);
3341 Lisp_Object contact = p->childp; 3341 Lisp_Object contact = p->childp;
3342 int optbits = 0; 3342 int optbits = 0;
diff --git a/src/sysdep.c b/src/sysdep.c
index cf2982bca11..889ad6bdb01 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -3239,7 +3239,7 @@ system_process_attributes (Lisp_Object pid)
3239 struct group *gr; 3239 struct group *gr;
3240 long clocks_per_sec; 3240 long clocks_per_sec;
3241 char *procfn_end; 3241 char *procfn_end;
3242 char procbuf[1025], *p, *q; 3242 char procbuf[1025], *p, *q UNINIT;
3243 int fd; 3243 int fd;
3244 ssize_t nread; 3244 ssize_t nread;
3245 static char const default_cmd[] = "???"; 3245 static char const default_cmd[] = "???";
diff --git a/src/xfns.c b/src/xfns.c
index 6ed9ecaab5c..f365241bdb0 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -274,7 +274,7 @@ x_real_pos_and_offsets (struct frame *f,
274 should be the outer WM window. */ 274 should be the outer WM window. */
275 for (;;) 275 for (;;)
276 { 276 {
277 Window wm_window, rootw; 277 Window wm_window UNINIT, rootw UNINIT;
278 278
279#ifdef USE_XCB 279#ifdef USE_XCB
280 xcb_query_tree_cookie_t query_tree_cookie; 280 xcb_query_tree_cookie_t query_tree_cookie;
diff --git a/src/xterm.c b/src/xterm.c
index 7131497e693..06c84463c66 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10637,7 +10637,7 @@ get_current_wm_state (struct frame *f,
10637#ifdef USE_XCB 10637#ifdef USE_XCB
10638 xcb_get_property_cookie_t prop_cookie; 10638 xcb_get_property_cookie_t prop_cookie;
10639 xcb_get_property_reply_t *prop; 10639 xcb_get_property_reply_t *prop;
10640 xcb_atom_t *reply_data; 10640 xcb_atom_t *reply_data UNINIT;
10641#else 10641#else
10642 Display *dpy = FRAME_X_DISPLAY (f); 10642 Display *dpy = FRAME_X_DISPLAY (f);
10643 unsigned long bytes_remaining; 10643 unsigned long bytes_remaining;