Integrating this with Emacs I found that I had forgotten one macro
_GL_ATTRIBUTE_RETURNS_NONNULL, which I fixed by installing the attached followup
patch.
>From 68361201d9a6fee940eda0825084deac35effd35 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sun, 3 May 2020 14:32:38 -0700
Subject: [PATCH] attribute: add _GL_ATTRIBUTE_RETURNS_NONNULL

---
 ChangeLog           | 1 +
 lib/attribute.h     | 1 +
 m4/gnulib-common.m4 | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index fa1e2bdb7..693671e46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,7 @@
 	(_GL_ATTRIBUTE_NODISCARD, _GL_ATTRIBUTE_NOINLINE)
 	(_GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_NONSTRING)
 	(_GL_ATTRIBUTE_NOTHROW, _GL_ATTRIBUTE_PACKED, _GL_ATTRIBUTE_PURE)
+	(_GL_ATTRIBUTE_RETURNS_NONNULL)
 	(_GL_ATTRIBUTE_SENTINEL): New macros.
 	* modules/backup-rename, modules/backupfile, modules/c-vasnprintf:
 	* modules/fnmatch, modules/freopen-safer, modules/fts:
diff --git a/lib/attribute.h b/lib/attribute.h
index 4861c1736..bb7c550f1 100644
--- a/lib/attribute.h
+++ b/lib/attribute.h
@@ -51,6 +51,7 @@
 #define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
 #define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
 #define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
 #define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL(pos)
 #define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING(msg)
 
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 1a817662c..b0010d0e3 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -245,6 +245,12 @@ AC_DEFUN([gl_COMMON_BODY], [
 # define _GL_ATTRIBUTE_PURE
 #endif
 
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
 #if _GL_HAS_ATTRIBUTE (sentinel)
 # define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
 #else
-- 
2.17.1

Reply via email to