diff options
| author | Paul Eggert | 2022-05-27 11:27:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2022-05-27 11:45:01 -0700 |
| commit | cb57db513b3b5e2c5e09d197e63d6a921188d599 (patch) | |
| tree | 53f3a3cecb91c876ab7454b3af582ed4042f49be /src | |
| parent | 7f3d781dab9a7a153badb62fd538908cb6595105 (diff) | |
| download | emacs-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.h | 3 | ||||
| -rw-r--r-- | src/tparam.h | 5 | ||||
| -rw-r--r-- | src/xterm.h | 2 |
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 | ||
| 31 | extern FILE *emacs_fopen (char const *, char const *) ATTRIBUTE_MALLOC; | 31 | extern FILE *emacs_fopen (char const *, char const *) |
| 32 | ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC (fclose, 1); | ||
| 32 | extern void errputc (int); | 33 | extern void errputc (int); |
| 33 | extern void errwrite (void const *, ptrdiff_t); | 34 | extern void errwrite (void const *, ptrdiff_t); |
| 34 | extern void close_output_streams (void); | 35 | extern 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 *); | |||
| 32 | char *tgetstr (const char *, char **); | 34 | char *tgetstr (const char *, char **); |
| 33 | char *tgoto (const char *, int, int); | 35 | char *tgoto (const char *, int, int); |
| 34 | 36 | ||
| 35 | char *tparam (const char *, char *, int, int, int, int, int) ATTRIBUTE_MALLOC; | 37 | char *tparam (const char *, char *, int, int, int, int, int) |
| 38 | ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC_FREE; | ||
| 36 | 39 | ||
| 37 | extern char PC; | 40 | extern char PC; |
| 38 | extern char *BC; | 41 | extern 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); | |||
| 1542 | extern Atom x_intern_cached_atom (struct x_display_info *, const char *, | 1542 | extern Atom x_intern_cached_atom (struct x_display_info *, const char *, |
| 1543 | bool); | 1543 | bool); |
| 1544 | extern char *x_get_atom_name (struct x_display_info *, Atom, bool *) | 1544 | extern 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 |
| 1548 | extern bool xg_set_icon (struct frame *, Lisp_Object); | 1548 | extern bool xg_set_icon (struct frame *, Lisp_Object); |