diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-08-12 17:25:37 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-08-12 17:25:54 -0700 |
commit | a1e0868f74f7b2b6b77026734102bd453cf1933b (patch) | |
tree | 82780ea818ce15827cd7d3669839606f9c54faf0 /src | |
parent | ca10011898e2ceeded4027413a1488837199ad7a (diff) | |
download | emacs-a1e0868f74f7b2b6b77026734102bd453cf1933b.tar.gz |
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.c | 2 | ||||
-rw-r--r-- | src/fns.c | 2 | ||||
-rw-r--r-- | src/font.c | 2 | ||||
-rw-r--r-- | src/frame.c | 2 | ||||
-rw-r--r-- | src/process.c | 2 | ||||
-rw-r--r-- | src/sysdep.c | 2 | ||||
-rw-r--r-- | src/xfns.c | 2 | ||||
-rw-r--r-- | src/xterm.c | 2 |
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) else if (plain_integer || (CONSP (zone) && FIXNUMP (XCAR (zone)) && CONSP (XCDR (zone)))) { - Lisp_Object abbr = Qnil; + Lisp_Object abbr UNINIT; if (!plain_integer) { 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) */) CHECK_CONS (tem); - Lisp_Object tail = Qnil; + Lisp_Object tail UNINIT; FOR_EACH_TAIL (tem) tail = tem; 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) else { /* KEY=VAL pairs */ - Lisp_Object key = Qnil; + Lisp_Object key UNINIT; int prop; 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) Lisp_Object icon_left, icon_top; /* And with this. */ - Lisp_Object fullscreen = Qnil; + Lisp_Object fullscreen UNINIT; bool fullscreen_change = false; /* 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, int family; struct sockaddr *sa = NULL; int ret; - ptrdiff_t addrlen; + ptrdiff_t addrlen UNINIT; struct Lisp_Process *p = XPROCESS (proc); Lisp_Object contact = p->childp; 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) struct group *gr; long clocks_per_sec; char *procfn_end; - char procbuf[1025], *p, *q; + char procbuf[1025], *p, *q UNINIT; int fd; ssize_t nread; 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, should be the outer WM window. */ for (;;) { - Window wm_window, rootw; + Window wm_window UNINIT, rootw UNINIT; #ifdef USE_XCB 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, #ifdef USE_XCB xcb_get_property_cookie_t prop_cookie; xcb_get_property_reply_t *prop; - xcb_atom_t *reply_data; + xcb_atom_t *reply_data UNINIT; #else Display *dpy = FRAME_X_DISPLAY (f); unsigned long bytes_remaining; |