diff options
| author | Philipp Stephani | 2017-06-04 19:12:23 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-04 19:50:50 +0200 |
| commit | 9be8b2bf1d1679e7b60dd7d2dbfef2c68f046938 (patch) | |
| tree | 1bdf7a125dd9d6838559f7379a10b9982d1d3788 /src/dynlib.h | |
| parent | 366e25a6d1caa30d8d336ce556f90f9ee46ca531 (diff) | |
| download | emacs-9be8b2bf1d1679e7b60dd7d2dbfef2c68f046938.tar.gz emacs-9be8b2bf1d1679e7b60dd7d2dbfef2c68f046938.zip | |
Use ATTRIBUTE_MAY_ALIAS where alias violations are likely
In particular, alias violations are likely for the return values of
dlsym(3), which get cast around arbitrarily.
* src/emacs-module.c (Fmodule_load): Use ATTRIBUTE_MAY_ALIAS.
Diffstat (limited to 'src/dynlib.h')
| -rw-r--r-- | src/dynlib.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/dynlib.h b/src/dynlib.h index 6246c6a6642..1d53b8e5b2f 100644 --- a/src/dynlib.h +++ b/src/dynlib.h | |||
| @@ -24,11 +24,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 24 | 24 | ||
| 25 | typedef void *dynlib_handle_ptr; | 25 | typedef void *dynlib_handle_ptr; |
| 26 | dynlib_handle_ptr dynlib_open (const char *path); | 26 | dynlib_handle_ptr dynlib_open (const char *path); |
| 27 | void *dynlib_sym (dynlib_handle_ptr h, const char *sym); | ||
| 28 | typedef struct dynlib_function_ptr_nonce *(*dynlib_function_ptr) (void); | ||
| 29 | dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym); | ||
| 30 | const char *dynlib_error (void); | ||
| 31 | int dynlib_close (dynlib_handle_ptr h); | 27 | int dynlib_close (dynlib_handle_ptr h); |
| 28 | const char *dynlib_error (void); | ||
| 29 | |||
| 30 | ATTRIBUTE_MAY_ALIAS void *dynlib_sym (dynlib_handle_ptr h, const char *sym); | ||
| 31 | |||
| 32 | typedef struct dynlib_function_ptr_nonce *(ATTRIBUTE_MAY_ALIAS *dynlib_function_ptr) (void); | ||
| 33 | dynlib_function_ptr dynlib_func (dynlib_handle_ptr h, const char *sym); | ||
| 34 | |||
| 32 | /* 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 |
| 33 | its symbol name. If the file or symbol name could not be | 36 | its symbol name. If the file or symbol name could not be |
| 34 | determined, set the corresponding argument to NULL. */ | 37 | determined, set the corresponding argument to NULL. */ |