+2021-08-07 Bruno Haible <bruno@clisp.org>
+
+ read-file: Improve GCC 11 allocation-deallocation checking.
+ * lib/read-file.h: Include <stdlib.h> instead of <stddef.h>.
+ (fread_file, read_file): Declare that deallocation must happen through
+ 'free'.
+
2021-08-07 Bruno Haible <bruno@clisp.org>
pipe-filter-gi: Improve GCC 11 allocation-deallocation checking.
#ifndef READ_FILE_H
#define READ_FILE_H
-/* Get size_t. */
-#include <stddef.h>
+/* Get size_t, free(). */
+#include <stdlib.h>
/* Get FILE. */
#include <stdio.h>
/* Indicate that the file content contains sensitive information. */
#define RF_SENSITIVE 0x2
-extern char *fread_file (FILE * stream, int flags, size_t * length);
+extern char *fread_file (FILE * stream, int flags, size_t * length)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
-extern char *read_file (const char *filename, int flags, size_t * length);
+extern char *read_file (const char *filename, int flags, size_t * length)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
#endif /* READ_FILE_H */