]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify gcc -Og -Wuninitialized
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Aug 2018 00:25:37 +0000 (17:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Aug 2018 00:25:54 +0000 (17:25 -0700)
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.

src/editfns.c
src/fns.c
src/font.c
src/frame.c
src/process.c
src/sysdep.c
src/xfns.c
src/xterm.c

index 71eb2a880900a3f1eeee0b928335664def593750..d2281d7e81c1e0383432df651e1cb74141d35621 100644 (file)
@@ -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));
index 7af2273f7e9e4e647e00a9c05e923e84fdb33156..f6e6803641329941c7bca05e3089f17d6d551e27 100644 (file)
--- 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;
 
index 9a0a9babd2769aeb1061d9b51eb12a94874dcd08..920ec1e02b12fd270f31538d9d56cd9b7bbb11d5 100644 (file)
@@ -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)
index 81642ccded31581955a3a2b58347b85dc5b24b60..ece8971d5b65a633dc3334ff714dffa119bc5faf 100644 (file)
@@ -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.  */
index c8123be28e8573f516067441eda2d0d468251ff5..a266da1c1b929b30e123bdeced781483a38cf488 100644 (file)
@@ -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;
index cf2982bca11866ae4b64e99da21306d0b34726ed..889ad6bdb01540680976bc52501445f2754ca675 100644 (file)
@@ -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[] = "???";
index 6ed9ecaab5c161e6e077288452b1641964e6dff5..f365241bdb098242c366ef11354662a455644078 100644 (file)
@@ -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;
index 7131497e693296496a7ae4da4ad16549a7309c1c..06c84463c66c3c872107cc25fee3d611db5c80db 100644 (file)
@@ -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;