aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2019-05-05 01:56:15 +0200
committerPhilipp Stephani2019-05-05 01:56:15 +0200
commitb5aeb86a7ef4c5cbfbbd95e72568b4b5e48e9bae (patch)
treebcd80bee9ba416dcb3750bf9e43de2df00e3ac16 /src
parenta976602066211f8820c0a2976afe81cad691a2c9 (diff)
downloademacs-b5aeb86a7ef4c5cbfbbd95e72568b4b5e48e9bae.tar.gz
emacs-b5aeb86a7ef4c5cbfbbd95e72568b4b5e48e9bae.zip
Avoid suppressing -Wcast-function-type warning.
GCC special-cases the type ‘void (*)(void)’ to not emit warnings when cast, see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcast-function-type. Make use of this to remove a warning suppression. * src/dynlib.h: Use void (*)(void) as generic function pointer type. * src/emacs-module.c: Remove warning suppression.
Diffstat (limited to 'src')
-rw-r--r--src/dynlib.h2
-rw-r--r--src/emacs-module.c5
2 files changed, 1 insertions, 6 deletions
diff --git a/src/dynlib.h b/src/dynlib.h
index 2688712a13e..43a0e045f5b 100644
--- a/src/dynlib.h
+++ b/src/dynlib.h
@@ -29,7 +29,7 @@ const char *dynlib_error (void);
29 29
30ATTRIBUTE_MAY_ALIAS void *dynlib_sym (dynlib_handle_ptr h, const char *sym); 30ATTRIBUTE_MAY_ALIAS void *dynlib_sym (dynlib_handle_ptr h, const char *sym);
31 31
32typedef struct dynlib_function_ptr_nonce *(ATTRIBUTE_MAY_ALIAS *dynlib_function_ptr) (void); 32typedef void (ATTRIBUTE_MAY_ALIAS *dynlib_function_ptr) (void);
33dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym); 33dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym);
34 34
35/* Sets *FILE to the file name from which PTR was loaded, and *SYM to 35/* Sets *FILE to the file name from which PTR was loaded, and *SYM to
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 1a7a21a4a8c..907a5d8225a 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -101,11 +101,6 @@ To add a new module function, proceed as follows:
101# pragma GCC diagnostic ignored "-Wclobbered" 101# pragma GCC diagnostic ignored "-Wclobbered"
102#endif 102#endif
103 103
104/* This module is lackadaisical about function casts. */
105#if GNUC_PREREQ (8, 0, 0)
106# pragma GCC diagnostic ignored "-Wcast-function-type"
107#endif
108
109/* We use different strategies for allocating the user-visible objects 104/* We use different strategies for allocating the user-visible objects
110 (struct emacs_runtime, emacs_env, emacs_value), depending on 105 (struct emacs_runtime, emacs_env, emacs_value), depending on
111 whether the user supplied the -module-assertions flag. If 106 whether the user supplied the -module-assertions flag. If