Bug 1128413, Part 4: Fix warnings in mozilla-config.h and gcc-stl-wrapper.template.h, r=glandium
authorBrian Smith <brian@briansmith.org>
Mon, 02 Feb 2015 17:35:19 -0800
changeset 244998 80a2f25792fc84d2137ed485d07e8afefefe06c8
parent 244997 d17a125c8ee74f60dfae9e5637885b9cc33bc667
child 244999 75c440d6b2fff1191f4a48807243e5be1783c12a
push idunknown
push userunknown
push dateunknown
reviewersglandium
bugs1128413
milestone38.0a1
Bug 1128413, Part 4: Fix warnings in mozilla-config.h and gcc-stl-wrapper.template.h, r=glandium
config/gcc-stl-wrapper.template.h
configure.in
memory/mozalloc/moz.build
memory/mozalloc/throw_msvc.h
mozilla-config.h.in
security/pkix/warnings.mozbuild
--- a/config/gcc-stl-wrapper.template.h
+++ b/config/gcc-stl-wrapper.template.h
@@ -5,17 +5,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_${HEADER}_h
 #define mozilla_${HEADER}_h
 
 // 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
 
 // Silence "warning: #include_next is a GCC extension"
 #pragma GCC system_header
 
 #ifdef _WIN32
 // Suppress windef.h min and max macros - they make std::min/max not compile.
--- a/configure.in
+++ b/configure.in
@@ -617,18 +617,18 @@ See https://developer.mozilla.org/en/Win
                                 [std::vector<int> v; return v.at(1);],
                                 ac_cv_have_dllimport_exception_bug="no",
                                 ac_cv_have_dllimport_exception_bug="yes")
                     CXXFLAGS="$_SAVE_CXXFLAGS"
                     AC_LANG_RESTORE
                 ])
             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,
                            ac_cv_have__RAISE,
                 [
                     AC_LANG_SAVE
                     AC_LANG_CPLUSPLUS
                     _SAVE_CXXFLAGS="$CXXFLAGS"
@@ -641,18 +641,18 @@ See https://developer.mozilla.org/en/Win
                                    [std::vector<int> v; return v.at(1);],
                                    ac_cv_have__RAISE="no",
                                    ac_cv_have__RAISE="yes")
                     CXXFLAGS="$_SAVE_CXXFLAGS"
                     AC_LANG_RESTORE
                 ])
             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
         fi
 
         if test "$WRAP_STL_INCLUDES" = "1"; then
             STL_FLAGS='-I$(DIST)/stl_wrappers'
         fi
@@ -762,18 +762,18 @@ AC_SUBST(GNU_AS)
 AC_SUBST(GNU_LD)
 AC_SUBST(GNU_CC)
 AC_SUBST(GNU_CXX)
 AC_SUBST(INTEL_CC)
 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.
 dnl ========================================================
 AC_PROG_INSTALL
 AC_PROG_LN_S
 
 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -6,17 +6,17 @@
 NO_VISIBILITY_FLAGS = True
 
 EXPORTS.mozilla += [
     'mozalloc.h',
     'mozalloc_abort.h',
     '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
 
 if CONFIG['WRAP_STL_INCLUDES']:
     if CONFIG['GNU_CXX']:
         EXPORTS.mozilla += ['throw_gcc.h']
     elif CONFIG['_MSC_VER']:
--- a/memory/mozalloc/throw_msvc.h
+++ b/memory/mozalloc/throw_msvc.h
@@ -3,17 +3,17 @@
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #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"
 #endif
 
 #endif  // mozilla_throw_msvc_h
--- a/mozilla-config.h.in
+++ b/mozilla-config.h.in
@@ -1,15 +1,22 @@
 /* List of defines generated by configure. Included with preprocessor flag,
  * -include, to avoid long list of -D defines on the compile command-line.
  * 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@
 
 /*
  * The c99 defining the limit macros (UINT32_MAX for example), says:
  *
  *   C++ implementations should define these macros only when
  *   __STDC_LIMIT_MACROS is defined before <stdint.h> is included.
@@ -20,16 +27,20 @@
  * with the fprintf function family.
  */
 #define __STDC_LIMIT_MACROS
 #define __STDC_CONSTANT_MACROS
 #if !defined(__STDC_FORMAT_MACROS)
 #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
  * not attempt to define PRUnichar.  This includes the following hunspell-specific
  * includes.
  *
  * We don't use this to build elfhack and elf-dynstr-gc since those builds happen
  * during the export tier.  Also, disable this when building assembly files too.
@@ -55,10 +66,9 @@
  *
  * CHROMIUM_SANDBOX_BUILD is defined in security/sandbox/moz.build.
  * Note that this include path relies on the LOCAL_INCLUDES in that file.
  */
 #if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN)
 #include "base/win/sdkdecls.h"
 #endif
 
-#endif /* _MOZILLA_CONFIG_H_ */
-
+#endif /* MOZILLA_CONFIG_H */
--- a/security/pkix/warnings.mozbuild
+++ b/security/pkix/warnings.mozbuild
@@ -4,19 +4,17 @@ if CONFIG['CLANG_CXX']:
   CXXFLAGS += [
     '-Weverything',
 
     '-Wno-c++98-compat',
     '-Wno-c++98-compat-pedantic',
     '-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']:
   CXXFLAGS += [
     '-sdl', # Enable additional security checks based on Microsoft's SDL.
 
     '-Wall',