aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2022-05-27 11:27:08 -0700
committerPaul Eggert2022-05-27 11:45:01 -0700
commitcb57db513b3b5e2c5e09d197e63d6a921188d599 (patch)
tree53f3a3cecb91c876ab7454b3af582ed4042f49be /src
parent7f3d781dab9a7a153badb62fd538908cb6595105 (diff)
downloademacs-cb57db513b3b5e2c5e09d197e63d6a921188d599.tar.gz
emacs-cb57db513b3b5e2c5e09d197e63d6a921188d599.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/sysstdio.h3
-rw-r--r--src/tparam.h5
-rw-r--r--src/xterm.h2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/sysstdio.h b/src/sysstdio.h
index 727a466be52..efedc3e450b 100644
--- a/src/sysstdio.h
+++ b/src/sysstdio.h
@@ -28,7 +28,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
28#include <attribute.h> 28#include <attribute.h>
29#include <unlocked-io.h> 29#include <unlocked-io.h>
30 30
31extern FILE *emacs_fopen (char const *, char const *) ATTRIBUTE_MALLOC; 31extern FILE *emacs_fopen (char const *, char const *)
32 ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC (fclose, 1);
32extern void errputc (int); 33extern void errputc (int);
33extern void errwrite (void const *, ptrdiff_t); 34extern void errwrite (void const *, ptrdiff_t);
34extern void close_output_streams (void); 35extern void close_output_streams (void);
diff --git a/src/tparam.h b/src/tparam.h
index 653f01bdde0..4f4bdc8820f 100644
--- a/src/tparam.h
+++ b/src/tparam.h
@@ -20,6 +20,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
20#ifndef EMACS_TPARAM_H 20#ifndef EMACS_TPARAM_H
21#define EMACS_TPARAM_H 21#define EMACS_TPARAM_H
22 22
23#include <stdlib.h>
24
23#include <attribute.h> 25#include <attribute.h>
24 26
25/* Don't try to include termcap.h. On some systems, configure finds a 27/* Don't try to include termcap.h. On some systems, configure finds a
@@ -32,7 +34,8 @@ int tgetnum (const char *);
32char *tgetstr (const char *, char **); 34char *tgetstr (const char *, char **);
33char *tgoto (const char *, int, int); 35char *tgoto (const char *, int, int);
34 36
35char *tparam (const char *, char *, int, int, int, int, int) ATTRIBUTE_MALLOC; 37char *tparam (const char *, char *, int, int, int, int, int)
38 ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC_FREE;
36 39
37extern char PC; 40extern char PC;
38extern char *BC; 41extern char *BC;
diff --git a/src/xterm.h b/src/xterm.h
index 329fa4c84f6..283d4fa9b11 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1542,7 +1542,7 @@ extern void x_own_selection (Lisp_Object, Lisp_Object, Lisp_Object);
1542extern Atom x_intern_cached_atom (struct x_display_info *, const char *, 1542extern Atom x_intern_cached_atom (struct x_display_info *, const char *,
1543 bool); 1543 bool);
1544extern char *x_get_atom_name (struct x_display_info *, Atom, bool *) 1544extern char *x_get_atom_name (struct x_display_info *, Atom, bool *)
1545 ATTRIBUTE_MALLOC; 1545 ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC_FREE;
1546 1546
1547#ifdef USE_GTK 1547#ifdef USE_GTK
1548extern bool xg_set_icon (struct frame *, Lisp_Object); 1548extern bool xg_set_icon (struct frame *, Lisp_Object);