warnings.mozbuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. if CONFIG['CLANG_CXX']:
  2. CXXFLAGS += [
  3. '-Weverything',
  4. '-Wno-c++98-compat',
  5. '-Wno-c++98-compat-pedantic',
  6. '-Wno-missing-prototypes',
  7. '-Wno-missing-variable-declarations',
  8. '-Wno-padded',
  9. '-Wno-reserved-id-macro', # NSPR and NSS use reserved IDs in their include guards.
  10. '-Wno-shadow', # XXX: Clang's rules are too strict for constructors.
  11. '-Wno-weak-vtables', # We rely on the linker to merge the duplicate vtables.
  12. ]
  13. elif CONFIG['_MSC_VER']:
  14. CXXFLAGS += [
  15. '-sdl', # Enable additional security checks based on Microsoft's SDL.
  16. '-Wall',
  17. '-wd4464', # relative include path contains '..'
  18. '-wd4514', # 'function': unreferenced inline function has been removed
  19. '-wd4668', # warning C4668: 'X' is not defined as a preprocessor macro,
  20. # replacing with '0' for '#if/#elif'.
  21. '-wd4710', # 'function': function not inlined
  22. '-wd4711', # function 'function' selected for inline expansion
  23. '-wd4800', # forcing value to bool 'true' or 'false'
  24. '-wd4820', # 'bytes' bytes padding added after construct 'member_name'
  25. # XXX: We cannot use /Za (Disable Microsoft Extensions) because windows.h
  26. # won't copmile with it.
  27. '-Zc:forScope', # Standard C++ rules for variable scope in for loops.
  28. '-Zc:inline', # Standard C++ rules requiring definition inline functions.
  29. '-Zc:rvalueCast', # Standard C++ rules for result of cast being an rvalue.
  30. '-Zc:strictStrings', # Standard C++ rule that string literals are const.
  31. ]
  32. else:
  33. CXXFLAGS += [
  34. '-Wall',
  35. '-Wextra',
  36. '-pedantic-errors',
  37. ]