Bug 1393498 Mark the stub_BaseThreadInitThunk as MOZ_NORETURN to silence a warning about a noreturn function not returning r=dmajor,froydnj

/home/worker/workspace/build/src/mozglue/build/WindowsDllBlocklist.cpp:816:1: error: 'noreturn' function does return [-Werror]

MozReview-Commit-ID: SYgPDW0sMV

--HG--
extra : rebase_source : 27b1dda404b3fc5fab95dd524677387bad921751
This commit is contained in:
Tom Ritter 2017-08-24 22:49:09 -05:00
parent b0e140e2a2
commit 92ff663a31
2 changed files with 10 additions and 1 deletions

View File

@ -66,6 +66,7 @@
#elif defined(__GNUC__)
# define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
# define MOZ_HAVE_NORETURN __attribute__((noreturn))
# define MOZ_HAVE_NORETURN_PTR __attribute__((noreturn))
#endif
/*
@ -102,6 +103,9 @@
* warnings about not initializing variables, or about any other seemingly-dodgy
* operations performed after the function returns.
*
* There are two variants. The GCC version of NORETURN may be applied to a
* function pointer, while for MSVC it may not.
*
* This modifier does not affect the corresponding function's linking behavior.
*/
#if defined(MOZ_HAVE_NORETURN)
@ -109,6 +113,11 @@
#else
# define MOZ_NORETURN /* no support */
#endif
#if defined(MOZ_HAVE_NORETURN_PTR)
# define MOZ_NORETURN_PTR MOZ_HAVE_NORETURN_PTR
#else
# define MOZ_NORETURN_PTR /* no support */
#endif
/**
* MOZ_COLD tells the compiler that a function is "cold", meaning infrequently

View File

@ -300,7 +300,7 @@ printf_stderr(const char *fmt, ...)
#ifdef _M_IX86
typedef void (__fastcall* BaseThreadInitThunk_func)(BOOL aIsInitialThread, void* aStartAddress, void* aThreadParam);
typedef MOZ_NORETURN_PTR void (__fastcall* BaseThreadInitThunk_func)(BOOL aIsInitialThread, void* aStartAddress, void* aThreadParam);
static BaseThreadInitThunk_func stub_BaseThreadInitThunk = nullptr;
#endif