diff --git a/src/timefns.c b/src/timefns.c
index f0e2e97f555..a9921cdc108 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -19,6 +19,11 @@ along with GNU Emacs. If not, see . */
#include
+/* Work around GCC bug 102671. */
+#if 10 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
+#endif
+
#include "systime.h"
#include "blockinput.h"
diff --git a/src/window.c b/src/window.c
index a6e8ee0d534..ec3c941c3bf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -20,6 +20,11 @@ along with GNU Emacs. If not, see . */
#include
+/* Work around GCC bug 102671. */
+#if 10 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
+#endif
+
#include "lisp.h"
#include "buffer.h"
#include "keyboard.h"