* lib/savedir.c: Ignore -Wanalyzer-malloc-leak and
-Wanalyzer-null-dereference.
---
 ChangeLog     | 4 ++++
 lib/savedir.c | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 250db951e5..4680deb9db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-02-17  Paul Eggert  <egg...@cs.ucla.edu>
 
+       savedir: work around GCC bug 113963
+       * lib/savedir.c: Ignore -Wanalyzer-malloc-leak and
+       -Wanalyzer-null-dereference.
+
        Solaris EOL update
        * doc/solaris-versions: Solaris 11.4 EOL update.  Also mention 11.3.
 
diff --git a/lib/savedir.c b/lib/savedir.c
index ca53bed736..80049ca1de 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -38,6 +38,12 @@
 #include "attribute.h"
 #include "xalloc.h"
 
+/* Pacify GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113963>.  */
+#if 13 <= __GNUC__
+# pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
+# pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
+#endif
+
 typedef struct
 {
   /* Offset of file name in name_space.  */
-- 
2.43.1


Reply via email to