Bug 1316545 part 7 - Suppress the warning of invalid noreturn for static analysis. r?froydnj draft
authorTing-Yu Chou <janus926@gmail.com>
Fri, 25 Nov 2016 16:22:00 +0800
changeset 443892 2ed6cbcaa4fa84b2feb7412e3b1f8b7007404b58
parent 443891 f07be88aeb087339f8261d21c2a817dc3b844ce6
child 538180 f9b527ff70bdb3ce4cad0f970f789b27fb0c5565
push id37133
push userbmo:janus926@gmail.com
push dateFri, 25 Nov 2016 11:04:17 +0000
reviewersfroydnj
bugs1316545
milestone53.0a1
Bug 1316545 part 7 - Suppress the warning of invalid noreturn for static analysis. r?froydnj MozReview-Commit-ID: CXt1DezWsgL
mfbt/Assertions.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -210,17 +210,24 @@ MOZ_ReportCrash(const char* aStr, const 
     * compiler doesn't hassle us to provide a return statement after a
     * MOZ_REALLY_CRASH() call.
     *
     * (Technically these are Windows requirements, not MSVC requirements.  But
     * practically you need MSVC for debugging, and we only ship builds created
     * by MSVC, so doing it this way reduces complexity.)
     */
 
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Winvalid-noreturn"
+#endif
 __declspec(noreturn) __inline void MOZ_NoReturn() {}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
 
 #  ifdef __cplusplus
 #    define MOZ_REALLY_CRASH() \
        do { \
          ::__debugbreak(); \
          *((volatile int*) NULL) = __LINE__; \
          ::TerminateProcess(::GetCurrentProcess(), 3); \
          ::MOZ_NoReturn(); \