From ae269bf4d7c9850b54f5a80624cd9d57d4f2a48a Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 2 Feb 2015 17:35:19 -0800 Subject: [PATCH] Bug 1128413, Part 4: Fix warnings in mozilla-config.h and gcc-stl-wrapper.template.h, r=glandium --- config/gcc-stl-wrapper.template.h | 2 +- configure.in | 12 ++++++------ memory/mozalloc/moz.build | 2 +- memory/mozalloc/throw_msvc.h | 4 ++-- mozilla-config.h.in | 18 ++++++++++++++---- security/pkix/warnings.mozbuild | 2 -- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/config/gcc-stl-wrapper.template.h b/config/gcc-stl-wrapper.template.h index e0b6490d9b2be..7fbf6b5190ecb 100644 --- a/config/gcc-stl-wrapper.template.h +++ b/config/gcc-stl-wrapper.template.h @@ -10,7 +10,7 @@ // For some reason, Apple's GCC refuses to honor -fno-exceptions when // compiling ObjC. -#if __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS) +#if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS) # error "STL code can only be used with -fno-exceptions" #endif diff --git a/configure.in b/configure.in index 5f62777644b40..7defd3da13a7b 100644 --- a/configure.in +++ b/configure.in @@ -622,8 +622,8 @@ See https://developer.mozilla.org/en/Windows_Build_Prerequisites.]) ]) if test "$ac_cv_have_dllimport_exception_bug" = "no"; then WRAP_STL_INCLUDES=1 - MOZ_MSVC_STL_WRAP__Throw=1 - AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw) + MOZ_MSVC_STL_WRAP_Throw=1 + AC_DEFINE(MOZ_MSVC_STL_WRAP_Throw) fi else AC_CACHE_CHECK(for overridable _RAISE, @@ -646,8 +646,8 @@ See https://developer.mozilla.org/en/Windows_Build_Prerequisites.]) ]) if test "$ac_cv_have__RAISE" = "yes"; then WRAP_STL_INCLUDES=1 - MOZ_MSVC_STL_WRAP__RAISE=1 - AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE) + MOZ_MSVC_STL_WRAP_RAISE=1 + AC_DEFINE(MOZ_MSVC_STL_WRAP_RAISE) else AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.]) fi @@ -767,8 +767,8 @@ AC_SUBST(INTEL_CXX) AC_SUBST(STL_FLAGS) AC_SUBST(WRAP_STL_INCLUDES) -AC_SUBST(MOZ_MSVC_STL_WRAP__Throw) -AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE) +AC_SUBST(MOZ_MSVC_STL_WRAP_Throw) +AC_SUBST(MOZ_MSVC_STL_WRAP_RAISE) dnl ======================================================== dnl Checks for programs. diff --git a/memory/mozalloc/moz.build b/memory/mozalloc/moz.build index 3f952879959bd..9ccf7cb39f940 100644 --- a/memory/mozalloc/moz.build +++ b/memory/mozalloc/moz.build @@ -11,7 +11,7 @@ EXPORTS.mozilla += [ 'mozalloc_oom.h', ] -if CONFIG['MOZ_MSVC_STL_WRAP__RAISE'] or CONFIG['MOZ_MSVC_STL_WRAP__Throw']: +if CONFIG['MOZ_MSVC_STL_WRAP_RAISE'] or CONFIG['MOZ_MSVC_STL_WRAP_Throw']: build_msvc_wrappers = 1 else: build_msvc_wrappers = 0 diff --git a/memory/mozalloc/throw_msvc.h b/memory/mozalloc/throw_msvc.h index ef24fb0220b38..3169e75f3fa64 100644 --- a/memory/mozalloc/throw_msvc.h +++ b/memory/mozalloc/throw_msvc.h @@ -8,9 +8,9 @@ #ifndef mozilla_throw_msvc_h #define mozilla_throw_msvc_h -#if defined(MOZ_MSVC_STL_WRAP__RAISE) +#if defined(MOZ_MSVC_STL_WRAP_RAISE) # include "msvc_raise_wrappers.h" -#elif defined(MOZ_MSVC_STL_WRAP__Throw) +#elif defined(MOZ_MSVC_STL_WRAP_Throw) # include "msvc_throw_wrapper.h" #else # error "Unknown STL wrapper tactic" diff --git a/mozilla-config.h.in b/mozilla-config.h.in index a8eb97d483d6f..c427e2aa876cb 100644 --- a/mozilla-config.h.in +++ b/mozilla-config.h.in @@ -3,8 +3,15 @@ * Do not edit. */ -#ifndef _MOZILLA_CONFIG_H_ -#define _MOZILLA_CONFIG_H_ +#ifndef MOZILLA_CONFIG_H +#define MOZILLA_CONFIG_H + +#if defined(__clang__) +#pragma clang diagnostic push +#if __has_warning("-Wreserved-id-macro") +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#endif +#endif @ALLDEFINES@ @@ -25,6 +32,10 @@ #define __STDC_FORMAT_MACROS #endif +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + /* * Force-include Char16.h in order to define PRUnichar as char16_t everywhere. * Note that this should be the first #include to make sure that prtypes.h does @@ -60,5 +71,4 @@ #include "base/win/sdkdecls.h" #endif -#endif /* _MOZILLA_CONFIG_H_ */ - +#endif /* MOZILLA_CONFIG_H */ diff --git a/security/pkix/warnings.mozbuild b/security/pkix/warnings.mozbuild index c8c8d2fb5fc50..10aa0f3b4fef8 100644 --- a/security/pkix/warnings.mozbuild +++ b/security/pkix/warnings.mozbuild @@ -9,9 +9,7 @@ if CONFIG['CLANG_CXX']: '-Wno-missing-prototypes', '-Wno-missing-variable-declarations', '-Wno-padded', - '-Wno-reserved-id-macro', # XXX: Will be removed in bug 1128413, Part 4. '-Wno-shadow', # XXX: Clang's rules are too strict for constructors. - '-Wno-undef', # XXX: Will be removed in bug 1128413, Part 4. '-Wno-weak-vtables', # We rely on the linker to merge the duplicate vtables. ] elif CONFIG['_MSC_VER']: