[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-28 cc3fc94 1/2: Pacify gcc 11.2.1 -Wanalyzer-null-argument
From: |
Paul Eggert |
Subject: |
emacs-28 cc3fc94 1/2: Pacify gcc 11.2.1 -Wanalyzer-null-argument |
Date: |
Sun, 3 Oct 2021 19:55:26 -0400 (EDT) |
branch: emacs-28
commit cc3fc94f09332e5cca28fea1f19a93c8d45fd0f8
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Pacify gcc 11.2.1 -Wanalyzer-null-argument
* src/gtkutil.c (xg_item_label_same_p): Clarify boolean expression
to pacify -Wanalyzer-null-argument with GCC 11.2.1 20210728
(Red Hat 11.2.1-1).
---
src/gtkutil.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 313cfc8..e87845c 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2932,8 +2932,9 @@ xg_item_label_same_p (GtkMenuItem *witem, const char
*label)
char *utf8_label = get_utf8_string (label);
const char *old_label = witem ? xg_get_menu_item_label (witem) : 0;
- bool is_same = (!old_label == !utf8_label
- && (!old_label || strcmp (utf8_label, old_label) == 0));
+ bool is_same = (old_label
+ ? utf8_label && strcmp (utf8_label, old_label) == 0
+ : !utf8_label);
if (utf8_label) g_free (utf8_label);