Bug 1493414 - Re-enable warnings as errors on clang-cl in toolkit/xre/. r=froydnj

_CrtSetReportXxxx stuff is dead decause we do not use debug CRT even in debug
builds for a long time. So I removed it to fix -Wunused-function.

--HG--
extra : source : ba00278fc1deee805e7ed13d0dc0658dee13465c
extra : intermediate-source : 5ffdd1f9f2562f9915f3c8805218fa33a908be20
This commit is contained in:
Masatoshi Kimura 2018-09-18 22:04:28 +09:00
parent 79c1eec12d
commit 209fbc21cd
5 changed files with 4 additions and 71 deletions

View File

@ -233,6 +233,3 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
if CONFIG['MOZ_IPDL_TESTS']:
DEFINES['MOZ_IPDL_TESTS'] = True
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

View File

@ -1648,48 +1648,6 @@ DumpHelp()
DumpArbitraryHelp();
}
#if defined(DEBUG) && defined(XP_WIN)
#ifdef DEBUG_warren
#define _CRTDBG_MAP_ALLOC
#endif
// Set a CRT ReportHook function to capture and format MSCRT
// warnings, errors and assertions.
// See http://msdn.microsoft.com/en-US/library/74kabxyx(v=VS.80).aspx
#include <stdio.h>
#include <crtdbg.h>
#include "mozilla/mozalloc_abort.h"
static int MSCRTReportHook( int aReportType, char *aMessage, int *oReturnValue)
{
*oReturnValue = 0; // continue execution
// Do not use fprintf or other functions which may allocate
// memory from the heap which may be corrupted. Instead,
// use fputs to output the leading portion of the message
// and use mozalloc_abort to emit the remainder of the
// message.
switch(aReportType) {
case 0:
fputs("\nWARNING: CRT WARNING", stderr);
fputs(aMessage, stderr);
fputs("\n", stderr);
break;
case 1:
fputs("\n###!!! ABORT: CRT ERROR ", stderr);
mozalloc_abort(aMessage);
break;
case 2:
fputs("\n###!!! ABORT: CRT ASSERT ", stderr);
mozalloc_abort(aMessage);
break;
}
// do not invoke the debugger
return 1;
}
#endif
static inline void
DumpVersion()
{
@ -1806,7 +1764,7 @@ RegisterApplicationRestartChanged(const char* aPref, void* aData) {
// Excludes argv[0] because RegisterApplicationRestart adds the
// executable name, replace that temporarily with -os-restarted
char* exeName = gRestartArgv[0];
gRestartArgv[0] = "-os-restarted";
gRestartArgv[0] = const_cast<char*>("-os-restarted");
wchar_t** restartArgvConverted =
AllocConvertUTF8toUTF16Strings(gRestartArgc, gRestartArgv);
gRestartArgv[0] = exeName;
@ -5332,21 +5290,6 @@ SetupErrorHandling(const char* progname)
#endif
#if defined (DEBUG) && defined(XP_WIN)
// Send MSCRT Warnings, Errors and Assertions to stderr.
// See http://msdn.microsoft.com/en-us/library/1y71x448(v=VS.80).aspx
// and http://msdn.microsoft.com/en-us/library/a68f826y(v=VS.80).aspx.
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
_CrtSetReportHook(MSCRTReportHook);
#endif
InstallSignalHandlers(progname);
// Unbuffer stdout, needed for tinderbox tests.

View File

@ -840,15 +840,6 @@ static nsCString hszValue( DWORD instance, HSZ hsz ) {
result += "]";
return result;
}
#else
// These are purely a safety measure to avoid the infamous "won't
// build non-debug" type Tinderbox flames.
static nsCString uTypeDesc( UINT ) {
return nsCString( "?" );
}
static nsCString hszValue( DWORD, HSZ ) {
return nsCString( "?" );
}
#endif

View File

@ -297,6 +297,7 @@ IsOlderVersion(nsIFile *versionFile, const char *appVersion)
return false;
}
#if !defined(XP_WIN)
static bool
CopyFileIntoUpdateDir(nsIFile *parentDir, const nsACString& leaf, nsIFile *updateDir)
{
@ -363,6 +364,7 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir, nsIFile *appDir, nsIFile *updateDir,
rv = updater->AppendNative(NS_LITERAL_CSTRING(UPDATER_BIN));
return NS_SUCCEEDED(rv);
}
#endif
/**
* Appends the specified path to the library path.

View File

@ -114,7 +114,7 @@ WinLaunchChild(const wchar_t *exePath,
STARTUPINFOW si = {0};
si.cb = sizeof(STARTUPINFOW);
si.lpDesktop = L"winsta0\\Default";
si.lpDesktop = const_cast<LPWSTR>(L"winsta0\\Default");
PROCESS_INFORMATION pi = {0};
if (userToken == nullptr) {