1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-16 17:19:41 +00:00

Add ATTRIBUTE_DEALLOC to extern functions

This can help static checking.  It’s not as important for static
functions, where GCC can figure this stuff out own its own.
* src/sysstdio.h (emacs_fopen): Add ATTRIBUTE_DEALLOC (fclose, 1).
* src/tparam.h (tparam): Add ATTRIBUTE_DEALLOC_FREE.
Include stdlib.h so that ‘free’ is declared.
* src/xterm.h (x_get_atom_name): Add ATTRIBUTE_DEALLOC_FREE.
This commit is contained in:
Paul Eggert 2022-05-27 11:27:08 -07:00
parent 7f3d781dab
commit cb57db513b
3 changed files with 7 additions and 3 deletions

View File

@ -28,7 +28,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <attribute.h>
#include <unlocked-io.h>
extern FILE *emacs_fopen (char const *, char const *) ATTRIBUTE_MALLOC;
extern FILE *emacs_fopen (char const *, char const *)
ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC (fclose, 1);
extern void errputc (int);
extern void errwrite (void const *, ptrdiff_t);
extern void close_output_streams (void);

View File

@ -20,6 +20,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#ifndef EMACS_TPARAM_H
#define EMACS_TPARAM_H
#include <stdlib.h>
#include <attribute.h>
/* Don't try to include termcap.h. On some systems, configure finds a
@ -32,7 +34,8 @@ int tgetnum (const char *);
char *tgetstr (const char *, char **);
char *tgoto (const char *, int, int);
char *tparam (const char *, char *, int, int, int, int, int) ATTRIBUTE_MALLOC;
char *tparam (const char *, char *, int, int, int, int, int)
ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC_FREE;
extern char PC;
extern char *BC;

View File

@ -1542,7 +1542,7 @@ extern void x_own_selection (Lisp_Object, Lisp_Object, Lisp_Object);
extern Atom x_intern_cached_atom (struct x_display_info *, const char *,
bool);
extern char *x_get_atom_name (struct x_display_info *, Atom, bool *)
ATTRIBUTE_MALLOC;
ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC_FREE;
#ifdef USE_GTK
extern bool xg_set_icon (struct frame *, Lisp_Object);