Back out 6a7bfd84596e (bug 736501) because it broke the build on some versions of GCC (bug 754198)

This commit is contained in:
Matt Brubeck 2012-05-11 20:15:47 -07:00
Родитель 0fb0b83ae6
Коммит 04c833ea52
6 изменённых файлов: 15 добавлений и 32 удалений

Просмотреть файл

@ -1757,15 +1757,11 @@ if test "$GNU_CC"; then
# -Werror=return-type - catches missing returns, zero false positives # -Werror=return-type - catches missing returns, zero false positives
# -Wtype-limits - catches overflow bugs, few false positives # -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Werror=unused-result - enforces __attribute__((warn_unused_result)); #
# Seldom used in system headers, but frequently in Mozilla code to
# enforce checking of fallible methods.
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type) MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits) MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body) MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
MOZ_C_SUPPORTS_WARNING(-W, error=unused-result, ac_c_has_werror_unused_result)
# Turn off the following warnings that -Wall/-pedantic turn on: # Turn off the following warnings that -Wall/-pedantic turn on:
# -Wno-unused - lots of violations in third-party code # -Wno-unused - lots of violations in third-party code
@ -1828,13 +1824,11 @@ if test "$GNU_CXX"; then
# -Werror=return-type - catches missing returns, zero false positives # -Werror=return-type - catches missing returns, zero false positives
# -Wtype-limits - catches overflow bugs, few false positives # -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Werror=unused-result - see above #
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type) MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits) MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body) MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
MOZ_CXX_SUPPORTS_WARNING(-W, error=unused-result, ac_cxx_has_werror_unused_result)
# Turn off the following warnings that -Wall/-pedantic turn on: # Turn off the following warnings that -Wall/-pedantic turn on:
# -Wno-ctor-dtor-privacy - ??? # -Wno-ctor-dtor-privacy - ???

Просмотреть файл

@ -444,7 +444,7 @@ ContentParent::ContentParent()
nsCString buildID(gAppData->buildID); nsCString buildID(gAppData->buildID);
//Sending all information to content process //Sending all information to content process
unused << SendAppInfo(version, buildID); SendAppInfo(version, buildID);
} }
} }
@ -730,10 +730,10 @@ ContentParent::Observe(nsISupports* aSubject,
unused << SendPMemoryReportRequestConstructor(); unused << SendPMemoryReportRequestConstructor();
} }
else if (!strcmp(aTopic, "child-gc-request")){ else if (!strcmp(aTopic, "child-gc-request")){
unused << SendGarbageCollect(); SendGarbageCollect();
} }
else if (!strcmp(aTopic, "child-cc-request")){ else if (!strcmp(aTopic, "child-cc-request")){
unused << SendCycleCollect(); SendCycleCollect();
} }
else if (!strcmp(aTopic, "last-pb-context-exited")) { else if (!strcmp(aTopic, "last-pb-context-exited")) {
unused << SendLastPrivateDocShellDestroyed(); unused << SendLastPrivateDocShellDestroyed();

Просмотреть файл

@ -47,7 +47,6 @@
#include "nsCoreAnimationSupport.h" #include "nsCoreAnimationSupport.h"
#endif #endif
#include "mozilla/unused.h"
#include "npfunctions.h" #include "npfunctions.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsDataHashtable.h" #include "nsDataHashtable.h"
@ -306,7 +305,7 @@ public:
nsresult HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled); nsresult HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled);
#endif #endif
void DidComposite() { unused << SendNPP_DidComposite(); } void DidComposite() { SendNPP_DidComposite(); }
private: private:
// Create an appropriate platform surface for a background of size // Create an appropriate platform surface for a background of size

Просмотреть файл

@ -1643,16 +1643,12 @@ if test "$GNU_CC"; then
# -Werror=return-type - catches missing returns, zero false positives # -Werror=return-type - catches missing returns, zero false positives
# -Wtype-limits - catches overflow bugs, few false positives # -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Werror=unused-result - enforces __attribute__((warn_unused_result)); #
# Seldom used in system headers, but frequently in Mozilla code to
# enforce checking of fallible methods.
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement" _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type) MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits) MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body) MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
MOZ_C_SUPPORTS_WARNING(-W, error=unused-result, ac_c_has_werror_unused_result)
# Turn off the following warnings that -Wall/-pedantic turn on: # Turn off the following warnings that -Wall/-pedantic turn on:
# -Wno-unused - lots of violations in third-party code # -Wno-unused - lots of violations in third-party code
# -Wno-overlength-strings - we exceed the minimum maximum length frequently # -Wno-overlength-strings - we exceed the minimum maximum length frequently
@ -1711,13 +1707,11 @@ if test "$GNU_CXX"; then
# -Werror=return-type - catches missing returns, zero false positives # -Werror=return-type - catches missing returns, zero false positives
# -Wtype-limits - catches overflow bugs, few false positives # -Wtype-limits - catches overflow bugs, few false positives
# -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
# -Werror=unused-result - see above #
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual" _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type) MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits) MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body) MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
MOZ_CXX_SUPPORTS_WARNING(-W, error=unused-result, ac_cxx_has_werror_unused_result)
# Turn off the following warnings that -Wall/-pedantic turn on: # Turn off the following warnings that -Wall/-pedantic turn on:
# -Wno-ctor-dtor-privacy - ??? # -Wno-ctor-dtor-privacy - ???

Просмотреть файл

@ -3,9 +3,6 @@
#include "nscore.h" #include "nscore.h"
#include "nsXULAppAPI.h" #include "nsXULAppAPI.h"
#include "nsExceptionHandler.h" #include "nsExceptionHandler.h"
#include "mozilla/unused.h"
using mozilla::unused;
/* /*
* This pure virtual call example is from MSDN * This pure virtual call example is from MSDN
@ -66,9 +63,9 @@ void Crash(PRInt16 how)
break; break;
} }
case CRASH_OOM: { case CRASH_OOM: {
unused << moz_xmalloc((size_t) -1); (void) moz_xmalloc((size_t) -1);
unused << moz_xmalloc((size_t) -1); (void) moz_xmalloc((size_t) -1);
unused << moz_xmalloc((size_t) -1); (void) moz_xmalloc((size_t) -1);
break; break;
} }
default: default:

Просмотреть файл

@ -39,7 +39,6 @@
#include "OfflineCacheUpdateParent.h" #include "OfflineCacheUpdateParent.h"
#include "nsOfflineCacheUpdate.h" #include "nsOfflineCacheUpdate.h"
#include "nsIApplicationCache.h" #include "nsIApplicationCache.h"
#include "mozilla/unused.h"
#if defined(PR_LOGGING) #if defined(PR_LOGGING)
// //
@ -143,7 +142,7 @@ OfflineCacheUpdateParent::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, PRU
LOG(("OfflineCacheUpdateParent::StateEvent [%p]", this)); LOG(("OfflineCacheUpdateParent::StateEvent [%p]", this));
unused << SendNotifyStateEvent(state); SendNotifyStateEvent(state);
if (state == nsIOfflineCacheUpdateObserver::STATE_FINISHED) { if (state == nsIOfflineCacheUpdateObserver::STATE_FINISHED) {
// Tell the child the particulars after the update has finished. // Tell the child the particulars after the update has finished.
@ -154,7 +153,7 @@ OfflineCacheUpdateParent::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, PRU
bool succeeded; bool succeeded;
aUpdate->GetSucceeded(&succeeded); aUpdate->GetSucceeded(&succeeded);
unused << SendFinish(succeeded, isUpgrade); SendFinish(succeeded, isUpgrade);
} }
return NS_OK; return NS_OK;
@ -173,7 +172,7 @@ OfflineCacheUpdateParent::ApplicationCacheAvailable(nsIApplicationCache *aApplic
nsCString cacheGroupId; nsCString cacheGroupId;
aApplicationCache->GetGroupID(cacheGroupId); aApplicationCache->GetGroupID(cacheGroupId);
unused << SendAssociateDocuments(cacheGroupId, cacheClientId); SendAssociateDocuments(cacheGroupId, cacheClientId);
return NS_OK; return NS_OK;
} }