Bug 1052033 - Fix warnings in security/sandbox and mark as FAIL_ON_WARNINGS. r=smichaud

This commit is contained in:
Chris Peterson 2014-08-09 14:25:24 -07:00
parent 732d431695
commit 9fc003a14a
3 changed files with 14 additions and 3 deletions

View File

@ -16,7 +16,7 @@ extern "C" void sandbox_free_error(char *errorbuf);
namespace mozilla {
static const char *rules =
static const char rules[] =
"(version 1)\n"
"(deny default)\n"
"(allow signal (target self))\n"
@ -39,7 +39,7 @@ static const char *rules =
bool StartMacSandbox(MacSandboxInfo aInfo, nsCString &aErrorMessage)
{
if (!aInfo.type == MacSandboxType_Plugin) {
if (aInfo.type != MacSandboxType_Plugin) {
aErrorMessage.AppendPrintf("Unexpected sandbox type %u", aInfo.type);
return false;
}
@ -60,7 +60,7 @@ bool StartMacSandbox(MacSandboxInfo aInfo, nsCString &aErrorMessage)
if (errorbuf) {
aErrorMessage.AppendPrintf("sandbox_init() failed with error \"%s\"",
errorbuf);
printf(profile.get());
printf("profile: %s\n", profile.get());
sandbox_free_error(errorbuf);
}
return false;

View File

@ -13,3 +13,5 @@ SOURCES += [
]
FINAL_LIBRARY = 'xul'
FAIL_ON_WARNINGS = True

View File

@ -140,3 +140,12 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
LOCAL_INCLUDES += ['/nsprpub']
DISABLE_STL_WRAPPING = True
# Suppress warnings in third-party code.
if CONFIG['_MSC_VER']:
CXXFLAGS += [
'-wd4275', # non dll-interface class exception used as base for dll-interface class
'-wd4717', # recursive on all control paths, function will cause runtime stack overflow
]
FAIL_ON_WARNINGS = True