* lib/xstrndup.h: Include <stdlib.h> instead of <stddef.h>.
(xstrndup): Declare that deallocation must happen through 'free'.
+2021-08-07 Bruno Haible <bruno@clisp.org>
+
+ xstrndup: Improve GCC 11 allocation-deallocation checking.
+ * lib/xstrndup.h: Include <stdlib.h> instead of <stddef.h>.
+ (xstrndup): Declare that deallocation must happen through 'free'.
+
2021-08-07 Bruno Haible <bruno@clisp.org>
xstriconveh: Improve GCC 11 allocation-deallocation checking.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
-#include <stddef.h>
+#include <stdlib.h>
/* Return a newly allocated copy of at most N bytes of STRING.
In other words, return a copy of the initial segment of length N of
STRING. */
-extern char *xstrndup (const char *string, size_t n) _GL_ATTRIBUTE_MALLOC;
+extern char *xstrndup (const char *string, size_t n)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;