[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a1e0868: Pacify gcc -Og -Wuninitialized
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master a1e0868: Pacify gcc -Og -Wuninitialized |
Date: |
Sun, 12 Aug 2018 20:25:59 -0400 (EDT) |
branch: master
commit a1e0868f74f7b2b6b77026734102bd453cf1933b
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
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.
---
src/editfns.c | 2 +-
src/fns.c | 2 +-
src/font.c | 2 +-
src/frame.c | 2 +-
src/process.c | 2 +-
src/sysdep.c | 2 +-
src/xfns.c | 2 +-
src/xterm.c | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/editfns.c b/src/editfns.c
index 71eb2a8..d2281d7 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 7af2273..f6e6803 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 9a0a9ba..920ec1e 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 81642cc..ece8971 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 c8123be..a266da1 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 cf2982b..889ad6b 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 6ed9eca..f365241 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 7131497..06c8446 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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master a1e0868: Pacify gcc -Og -Wuninitialized,
Paul Eggert <=