Bug 1026589 - Enable more GCC/Clang compiler warnings (-Wextra) for security/certverifier. r?keeler
Original patch by Camilo Viecco.
MozReview-Commit-ID: 4LWpueoyQHL
--- a/security/certverifier/OCSPRequestor.cpp
+++ b/security/certverifier/OCSPRequestor.cpp
@@ -161,17 +161,17 @@ DoOCSPRequest(const UniquePLArenaPool& a
("Setting up OCSP request: pre all path =%s pathlen=%d\n", path.get(),
pathLen));
nsAutoCString method("POST");
if (useGET) {
method.Assign("GET");
if (!StringEndsWith(path, NS_LITERAL_CSTRING("/"))) {
path.Append("/");
}
- nsresult nsrv = AppendEscapedBase64Item(encodedRequest, path);
+ nsrv = AppendEscapedBase64Item(encodedRequest, path);
if (NS_WARN_IF(NS_FAILED(nsrv))) {
return Result::FATAL_ERROR_LIBRARY_FAILURE;
}
}
nsNSSHttpRequestSession* requestSessionPtr;
rv = nsNSSHttpInterface::createFcn(serverSession.get(), "http", path.get(),
method.get(), originAttributes, timeout,
--- a/security/certverifier/moz.build
+++ b/security/certverifier/moz.build
@@ -48,57 +48,65 @@ DIRS += [
]
TEST_DIRS += [
'tests/gtest',
]
CXXFLAGS += ['-Wall']
if CONFIG['_MSC_VER']:
- # -Wall with Visual C++ enables too many problematic warnings
- CXXFLAGS += [
- '-wd4355', # 'this' used in base member initializer list
- '-wd4464', # relative include path contains '..'
- '-wd4480', # nonstandard extension used: specifying underlying type for
- # enum 'enum'
- '-wd4481', # nonstandard extension used: override specifier 'keyword'
- '-wd4510', # default constructor could not be generated
- '-wd4512', # assignment operator could not be generated
- '-wd4514', # 'function': unreferenced inline function has been removed
- '-wd4610', # struct 'symbol' can never be instantiated - user defined
- # constructor required
- '-wd4619', # pragma warning: there is no warning 'warning'
- '-wd4623', # default constructor could not be generated because a base
- # class default constructor is inaccessible or deleted
- '-wd4625', # copy constructor could not be generated because a base
- # class copy constructor is inaccessible or deleted
- '-wd4626', # assignment operator could not be generated because a base
- # class assignment operator is inaccessible or deleted
- '-wd4640', # construction of local static object is not thread-safe
- '-wd4710', # 'function': function not inlined
- '-wd4711', # function 'function' selected for inline expansion
- '-wd4820', # 'bytes' bytes padding added after construct 'member_name'
- ]
+ # -Wall with Visual C++ enables too many problematic warnings
+ CXXFLAGS += [
+ '-wd4355', # 'this' used in base member initializer list
+ '-wd4464', # relative include path contains '..'
+ '-wd4480', # nonstandard extension used: specifying underlying type for
+ # enum 'enum'
+ '-wd4481', # nonstandard extension used: override specifier 'keyword'
+ '-wd4510', # default constructor could not be generated
+ '-wd4512', # assignment operator could not be generated
+ '-wd4514', # 'function': unreferenced inline function has been removed
+ '-wd4610', # struct 'symbol' can never be instantiated - user defined
+ # constructor required
+ '-wd4619', # pragma warning: there is no warning 'warning'
+ '-wd4623', # default constructor could not be generated because a base
+ # class default constructor is inaccessible or deleted
+ '-wd4625', # copy constructor could not be generated because a base
+ # class copy constructor is inaccessible or deleted
+ '-wd4626', # assignment operator could not be generated because a base
+ # class assignment operator is inaccessible or deleted
+ '-wd4640', # construction of local static object is not thread-safe
+ '-wd4710', # 'function': function not inlined
+ '-wd4711', # function 'function' selected for inline expansion
+ '-wd4820', # 'bytes' bytes padding added after construct 'member_name'
+ ]
- # MSVC 2010's headers trigger these
- CXXFLAGS += [
- '-wd4548', # expression before comma has no effect; ...
- '-wd4668', # 'symbol' is not defined as a preprocessor macro...
- '-wd4987', # nonstandard extension used
- ]
+ # MSVC 2010's headers trigger these
+ CXXFLAGS += [
+ '-wd4548', # expression before comma has no effect; ...
+ '-wd4668', # 'symbol' is not defined as a preprocessor macro...
+ '-wd4987', # nonstandard extension used
+ ]
- # MSVC 2015 triggers these
- CXXFLAGS += [
- '-wd4456', # declaration of 'rv' hides previous local declaration
- '-wd4458', # declaration of 'input' hides class member
- ]
+ # MSVC 2015 triggers these
+ CXXFLAGS += [
+ '-wd4456', # declaration of 'rv' hides previous local declaration
+ '-wd4458', # declaration of 'input' hides class member
+ ]
- # Gecko headers aren't warning-free enough for us to enable these warnings
- CXXFLAGS += [
- '-wd4100', # 'symbol' : unreferenced formal parameter
- '-wd4127', # conditional expression is constant
- '-wd4946', # reinterpret_cast used between related types
- ]
+ # Gecko headers aren't warning-free enough for us to enable these warnings
+ CXXFLAGS += [
+ '-wd4100', # 'symbol' : unreferenced formal parameter
+ '-wd4127', # conditional expression is constant
+ '-wd4946', # reinterpret_cast used between related types
+ ]
if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-error=shadow']
+ CXXFLAGS += [
+ '-Wextra',
+ '-Wunreachable-code',
+ ]
+
+ # Gecko headers aren't warning-free enough for us to enable these warnings.
+ CXXFLAGS += [
+ '-Wno-unused-parameter',
+ ]
FINAL_LIBRARY = 'xul'