зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1766359 - Fix unreachable-code-return warnings in Windows builds. r=emilio,mhowell,nika,rkraesig
dom/system/PathUtils.cpp(77,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return false; ^~~~~ ipc/chromium/src/chrome/common/ipc_channel_win.cc(479,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return true; ^~~~ mozglue/misc/PreXULSkeletonUI.cpp(1263,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return 0; ^ mozglue/tests/TestPEExportSection.cpp(348,12): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return 0; ^ security/manager/ssl/OSReauthenticator.cpp(428,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return NS_OK; ^~~~~ toolkit/components/maintenanceservice/maintenanceservice.cpp(214,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return 0; ^ widget/windows/WindowsUIUtils.cpp(383,10): error: 'return' will never be executed [-Werror,-Wunreachable-code-return] return false; ^~~~~ Differential Revision: https://phabricator.services.mozilla.com/D144661
This commit is contained in:
Родитель
deabbe0548
Коммит
3da3b13f2a
|
@ -65,7 +65,7 @@ check_and_add_warning("-Wno-error=tautological-type-limit-compare")
|
|||
|
||||
# catches some dead code
|
||||
add_warning("-Wunreachable-code", when=not_clang_cl)
|
||||
check_and_add_warning("-Wunreachable-code-return", when=not_clang_cl)
|
||||
check_and_add_warning("-Wunreachable-code-return")
|
||||
|
||||
# catches parameters that are set but not read
|
||||
# Only enable on clang because gcc reports false positives.
|
||||
|
|
|
@ -71,10 +71,12 @@ static bool DoWindowsPathCheck() {
|
|||
#ifdef XP_WIN
|
||||
# ifdef DEBUG
|
||||
return true;
|
||||
# endif // DEBUG
|
||||
# else // DEBUG
|
||||
return xpc::IsInAutomation();
|
||||
#endif // XP_WIN
|
||||
# endif // DEBUG
|
||||
#else // XP_WIN
|
||||
return false;
|
||||
#endif // XP_WIN
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -475,8 +475,6 @@ bool Channel::ChannelImpl::ProcessIncomingMessages(
|
|||
|
||||
bytes_read = 0; // Get more data.
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Channel::ChannelImpl::ProcessOutgoingMessages(
|
||||
|
|
|
@ -1259,8 +1259,6 @@ DWORD WINAPI AnimateSkeletonUI(void* aUnused) {
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT WINAPI PreXULSkeletonUIProc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
|
|
|
@ -345,7 +345,6 @@ class ChildProcess final {
|
|||
for (;;) {
|
||||
::Sleep(100);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ChildProcess(const wchar_t* aExecutable, const wchar_t* aOption,
|
||||
|
|
|
@ -424,8 +424,9 @@ static nsresult ReauthenticateUser(const nsAString& prompt,
|
|||
prefLastChanged, isAutoAdminLogonEnabled, isRequireSignonEnabled);
|
||||
#elif defined(XP_MACOSX)
|
||||
return ReauthenticateUserMacOS(prompt, reauthenticated, isBlankPassword);
|
||||
#endif // Reauthentication is not implemented for this platform.
|
||||
#else
|
||||
return NS_OK;
|
||||
#endif // Reauthentication is not implemented for this platform.
|
||||
}
|
||||
|
||||
static void BackgroundReauthenticateUser(RefPtr<Promise>& aPromise,
|
||||
|
|
|
@ -211,7 +211,6 @@ void BackupOldLogs(LPCWSTR basePath, int numLogsToKeep) {
|
|||
DWORD WINAPI EnsureProcessTerminatedThread(LPVOID) {
|
||||
Sleep(5000);
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void StartTerminationThread() {
|
||||
|
|
|
@ -379,8 +379,9 @@ bool WindowsUIUtils::ComputeOverlayScrollbars() {
|
|||
boolean autoHide = false;
|
||||
sUiSettings->get_AutoHideScrollBars(&autoHide);
|
||||
return autoHide;
|
||||
#endif
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void WindowsUIUtils::UpdateInTabletMode() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче