emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b5aeb86: Avoid suppressing -Wcast-function-type war


From: Philipp Stephani
Subject: [Emacs-diffs] master b5aeb86: Avoid suppressing -Wcast-function-type warning.
Date: Sat, 4 May 2019 19:57:56 -0400 (EDT)

branch: master
commit b5aeb86a7ef4c5cbfbbd95e72568b4b5e48e9bae
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    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.
---
 src/dynlib.h       | 2 +-
 src/emacs-module.c | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/dynlib.h b/src/dynlib.h
index 2688712..43a0e04 100644
--- a/src/dynlib.h
+++ b/src/dynlib.h
@@ -29,7 +29,7 @@ const char *dynlib_error (void);
 
 ATTRIBUTE_MAY_ALIAS void *dynlib_sym (dynlib_handle_ptr h, const char *sym);
 
-typedef struct dynlib_function_ptr_nonce *(ATTRIBUTE_MAY_ALIAS 
*dynlib_function_ptr) (void);
+typedef void (ATTRIBUTE_MAY_ALIAS *dynlib_function_ptr) (void);
 dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym);
 
 /* 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 1a7a21a..907a5d8 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -101,11 +101,6 @@ To add a new module function, proceed as follows:
 # pragma GCC diagnostic ignored "-Wclobbered"
 #endif
 
-/* This module is lackadaisical about function casts.  */
-#if GNUC_PREREQ (8, 0, 0)
-# pragma GCC diagnostic ignored "-Wcast-function-type"
-#endif
-
 /* We use different strategies for allocating the user-visible objects
    (struct emacs_runtime, emacs_env, emacs_value), depending on
    whether the user supplied the -module-assertions flag.  If



reply via email to

[Prev in Thread] Current Thread [Next in Thread]