diff options
author | Henrik Nord <[email protected]> | 2013-12-02 15:49:58 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2013-12-02 15:50:01 +0100 |
commit | 87054d91f9cb191274a56ac80a8ab29c4cb3a0ef (patch) | |
tree | 4e2e9dc83a55f5a0621d4790c181d56ca35a9bc5 /erts/emulator/beam/sys.h | |
parent | 3e7d99747edeb7b22f8c6cea937cdd830613dcad (diff) | |
parent | 80f95d2ab4352eef90ae2546a8e42f4ed82cd738 (diff) | |
download | otp-87054d91f9cb191274a56ac80a8ab29c4cb3a0ef.tar.gz otp-87054d91f9cb191274a56ac80a8ab29c4cb3a0ef.tar.bz2 otp-87054d91f9cb191274a56ac80a8ab29c4cb3a0ef.zip |
Merge branch 'nox/fix-clang-warnings' into maint
* nox/fix-clang-warnings:
Silence warnings about socklen_t pointers sign in erl_memory
Compile in_heapfrag() only in debug mode
Silence two warnings about tests being always true
Conditionally compile my_gethostbyname_r and my_gethostbyaddr_r
Silence a mismatching type pointer warning in ei_resolve
Silence warnings about different buffer types in erl_memory
erts: Remove unused file winsock_func.h
Silence warnings about unused return values in ic
Silence a warning in erl_poll about an empty loop body
Fix erts_check_off_heap2 assertion
Properly mark erl_assert_error as non-returning
Remove uninitialized use of new_crr in erl_alloc_util
OTP-11517
Diffstat (limited to 'erts/emulator/beam/sys.h')
-rw-r--r-- | erts/emulator/beam/sys.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index d22f125945..31252ed78f 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -149,9 +149,28 @@ typedef ERTS_SYS_FD_TYPE ErtsSysFdType; # define ERTS_EXIT_AFTER_DUMP exit #endif +/* In VC++, noreturn is a declspec that has to be before the types, + * but in GNUC it is an att ribute to be placed between return type + * and function name, hence __decl_noreturn <types> __noreturn <function name> + */ +#if __GNUC__ +# define __decl_noreturn +# define __noreturn __attribute__((noreturn)) +#else +# if defined(__WIN32__) && defined(_MSC_VER) +# define __noreturn +# define __decl_noreturn __declspec(noreturn) +# else +# define __noreturn +# define __decl_noreturn +# endif +#endif + #define ERTS_ASSERT(e) \ ((void) ((e) ? 1 : (erl_assert_error(#e, __func__, __FILE__, __LINE__), 0))) -void erl_assert_error(const char* expr, const char *func, const char* file, int line); + +__decl_noreturn void __noreturn erl_assert_error(const char* expr, const char *func, + const char* file, int line); #ifdef DEBUG # define ASSERT(e) ERTS_ASSERT(e) @@ -192,23 +211,6 @@ void erl_assert_error(const char* expr, const char *func, const char* file, int # define erts_align_attribute(SZ) #endif -/* In VC++, noreturn is a declspec that has to be before the types, - * but in GNUC it is an att ribute to be placed between return type - * and function name, hence __decl_noreturn <types> __noreturn <function name> - */ -#if __GNUC__ -# define __decl_noreturn -# define __noreturn __attribute__((noreturn)) -#else -# if defined(__WIN32__) && defined(_MSC_VER) -# define __noreturn -# define __decl_noreturn __declspec(noreturn) -# else -# define __noreturn -# define __decl_noreturn -# endif -#endif - /* ** Data types: ** |