summaryrefslogtreecommitdiff
path: root/src/xfont.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-07-12 00:00:20 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-07-12 00:12:20 -0700
commit2337869fbf8b967eb53ee57f978f3751987e43dc (patch)
tree4efade0869b4c3f1d23ba4e09bdfc19cc2f57778 /src/xfont.c
parentda2f772fe575b20bff51b49aa5ded2bf15a2c89d (diff)
downloademacs-2337869fbf8b967eb53ee57f978f3751987e43dc.tar.gz
Pacify gcc 11.1.1 -Wanalyzer-null-argument
* lib-src/etags.c (regexp): Omit member force_explicit_name, since it’s always true. All uses removed. This lets us remove calls to strlen (name) where GCC isn’t smart enough to deduce that name must be nonnull. * lib-src/movemail.c (main): Fix bug that could cause link (tempname, NULL) to be called. * src/emacs.c (argmatch): Break check into two ‘if’s, since GCC doesn’t seem to be smart enough to check the single ‘if’. * src/gtkutil.c (xg_update_menu_item): Fix bug where strcmp could be given a NULL arg. * src/xfont.c (xfont_list_family): Use nonnull value for dummy initial value.
Diffstat (limited to 'src/xfont.c')
-rw-r--r--src/xfont.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xfont.c b/src/xfont.c
index 0570ee96a90..81d356175a4 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -596,7 +596,10 @@ xfont_list_family (struct frame *f)
char **names;
int num_fonts, i;
Lisp_Object list;
- char *last_family UNINIT;
+ char const *last_family;
+#if defined GCC_LINT || defined lint
+ last_family = "";
+#endif
int last_len;
block_input ();