[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
xmemdup0: Improve GCC 11 allocation-deallocation checking
From: |
Bruno Haible |
Subject: |
xmemdup0: Improve GCC 11 allocation-deallocation checking |
Date: |
Sat, 07 Aug 2021 23:09:24 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) |
2021-08-07 Bruno Haible <bruno@clisp.org>
xmemdup0: Improve GCC 11 allocation-deallocation checking.
* lib/xmemdup0.h: Include <stdlib.h> instead of <stddef.h>.
(xmemdup0): Declare that deallocation must happen through 'free'.
diff --git a/lib/xmemdup0.h b/lib/xmemdup0.h
index 4f3b581..6e34348 100644
--- a/lib/xmemdup0.h
+++ b/lib/xmemdup0.h
@@ -18,14 +18,16 @@
#ifndef XMEMDUP_H_
# define XMEMDUP_H_
-# include <stddef.h>
+# include <stdlib.h>
# ifdef __cplusplus
extern "C" {
# endif
-char *xmemdup0 (void const *p, size_t s);
+char *xmemdup0 (void const *p, size_t s)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
# ifdef __cplusplus
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- xmemdup0: Improve GCC 11 allocation-deallocation checking,
Bruno Haible <=