2021-07-30 Paul Eggert <eggert@cs.ucla.edu>
+ gnulib-common: update for gcc -Wmismatched-dealloc
+ * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macros
+ _GL_ATTRIBUTE_DEALLOC and _GL_ATTRIBUTE_DEALLOC_FREE. These can
+ be useful with gcc -Wmismatched-dealloc.
+
gnulib-common: update for C2x 2020-12-11 draft
Use blessed-by-draft-standard way to test for [[__deprecated__]]
etc.; this is supported by GCC 11 and the fallback code should
# define _GL_ATTRIBUTE_CONST
#endif
+/* _GL_ATTRIBUTE_DEALLOC (F, I) is for functions returning pointers
+ that can be freed by passing them as the Ith argument to the
+ function F. _GL_ATTRIBUTE_DEALLOC_FREE is for functions that
+ return pointers that can be freed via 'free'; it can be used
+ only after including stdlib.h. */
+#if _GL_GNUC_PREREQ (11, 0)
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+#else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+#endif
+#define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+
#if _GL_HAS_C_ATTRIBUTE (deprecated)
# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
#elif _GL_HAS_ATTRIBUTE (deprecated)