tvl-depot/absl/copts/copts.py
Abseil Team f197d7c72a Export of internal Abseil changes.
--
1a5fb4eb5bc6c0332962f659470a07908168aa5c by CJ Johnson <johnsoncj@google.com>:

Move InlinedVector's AbslHashValue(...) definition to out of line

PiperOrigin-RevId: 224389234

--
b7c5ccdfe17b9cb5f7124c8d591ce0989a15b9fb by Jon Cohen <cohenjon@google.com>:

Add a shebang line and chmod +x generate_copts.py.  Note that we use the "python" command as suggested in PEP 934 (https://www.python.org/dev/peps/pep-0394/) as this script should work in both Python 2 and Python 3.

Also adds a gitignore for __pycache__ for when using python3

PiperOrigin-RevId: 224375405

--
c57a148a1106b21dbcd750541f10b058bf55a2bf by CJ Johnson <johnsoncj@google.com>:

Adds comment to InlinedVector intended to help the g4 diffing algo to better identify the substantive change

PiperOrigin-RevId: 224362807

--
b635ab981a07dc2434be7b0d164030a42cc67923 by Greg Falcon <gfalcon@google.com>:

internal change

PiperOrigin-RevId: 224362442

--
217021f7dcec31141a89b91930c241af062c2133 by CJ Johnson <johnsoncj@google.com>:

Distinguishes the source of InlinedVector::at(...)'s bounds checking exception

PiperOrigin-RevId: 224341645

--
01a5943560ce9216a9d8ccb1279b5c5c2f6e1019 by CJ Johnson <johnsoncj@google.com>:

Relocates out of line member function definitions to their respective declarations in InlinedVector

PiperOrigin-RevId: 224320130

--
b3d57fcddcd737e91aab812d69b82fef2ca43d7e by Abseil Team <absl-team@google.com>:

On 32-bit systems, the alignment of int64 can be 4 bytes. Created a custom Int64 type (to go with the custom Int128 type) just for the purpose of testing layouts and alignments; it doesn't need to support actual arithmetic.

PiperOrigin-RevId: 224209785
GitOrigin-RevId: 1a5fb4eb5bc6c0332962f659470a07908168aa5c
Change-Id: I9d6b1c441cd712709ebd6c0a8911d0755cab506f
2018-12-07 14:40:28 -05:00

156 lines
5.3 KiB
Python

"""Abseil compiler options.
This is the source of truth for Abseil compiler options. To modify Abseil
compilation options:
(1) Edit the appropriate list in this file.
(2) Run `<path_to_absl>/copts/generate_copts.py`.
The generated copts are consumed by configure_copts.bzl and
AbseilConfigureCopts.cmake.
"""
import collections # absl:google-only(used for internal flags)
COPT_VARS = {
"GCC_FLAGS": [
"-Wall",
"-Wextra",
"-Wcast-qual",
"-Wconversion-null",
"-Wmissing-declarations",
"-Woverlength-strings",
"-Wpointer-arith",
"-Wunused-local-typedefs",
"-Wunused-result",
"-Wvarargs",
"-Wvla", # variable-length array
"-Wwrite-strings",
# Google style does not use unsigned integers, though STL containers
# have unsigned types.
"-Wno-sign-compare",
],
"GCC_TEST_FLAGS": [
"-Wno-conversion-null",
"-Wno-missing-declarations",
"-Wno-sign-compare",
"-Wno-unused-function",
"-Wno-unused-parameter",
"-Wno-unused-private-field",
],
"GCC_EXCEPTIONS_FLAGS": ["-fexceptions"],
# Docs on single flags is preceded by a comment.
# Docs on groups of flags is preceded by ###.
"LLVM_FLAGS": [
"-Wall",
"-Wextra",
"-Weverything",
# Abseil does not support C++98
"-Wno-c++98-compat-pedantic",
# Turns off all implicit conversion warnings. Most are re-enabled below.
"-Wno-conversion",
"-Wno-covered-switch-default",
"-Wno-deprecated",
"-Wno-disabled-macro-expansion",
"-Wno-double-promotion",
###
# Turned off as they include valid C++ code.
"-Wno-comma",
"-Wno-extra-semi",
"-Wno-packed",
"-Wno-padded",
###
# Google style does not use unsigned integers, though STL containers
# have unsigned types.
"-Wno-sign-compare",
###
"-Wno-float-conversion",
"-Wno-float-equal",
"-Wno-format-nonliteral",
# Too aggressive: warns on Clang extensions enclosed in Clang-only
# compilation paths.
"-Wno-gcc-compat",
###
# Some internal globals are necessary. Don't do this at home.
"-Wno-global-constructors",
"-Wno-exit-time-destructors",
###
"-Wno-nested-anon-types",
"-Wno-non-modular-include-in-module",
"-Wno-old-style-cast",
# Warns on preferred usage of non-POD types such as string_view
"-Wno-range-loop-analysis",
"-Wno-reserved-id-macro",
"-Wno-shorten-64-to-32",
"-Wno-switch-enum",
"-Wno-thread-safety-negative",
"-Wno-undef",
"-Wno-unknown-warning-option",
"-Wno-unreachable-code",
# Causes warnings on include guards
"-Wno-unused-macros",
"-Wno-weak-vtables",
###
# Implicit conversion warnings turned off by -Wno-conversion
# which are re-enabled below.
"-Wbitfield-enum-conversion",
"-Wbool-conversion",
"-Wconstant-conversion",
"-Wenum-conversion",
"-Wint-conversion",
"-Wliteral-conversion",
"-Wnon-literal-null-conversion",
"-Wnull-conversion",
"-Wobjc-literal-conversion",
"-Wno-sign-conversion",
"-Wstring-conversion",
],
"LLVM_TEST_FLAGS": [
"-Wno-c99-extensions",
"-Wno-missing-noreturn",
"-Wno-missing-prototypes",
"-Wno-missing-variable-declarations",
"-Wno-null-conversion",
"-Wno-shadow",
"-Wno-shift-sign-overflow",
"-Wno-sign-compare",
"-Wno-unused-function",
"-Wno-unused-member-function",
"-Wno-unused-parameter",
"-Wno-unused-private-field",
"-Wno-unused-template",
"-Wno-used-but-marked-unused",
"-Wno-zero-as-null-pointer-constant",
# gtest depends on this GNU extension being offered.
"-Wno-gnu-zero-variadic-macro-arguments",
],
"LLVM_EXCEPTIONS_FLAGS": ["-fexceptions"],
# /Wall with msvc includes unhelpful warnings such as C4711, C4710, ...
"MSVC_FLAGS": [
"/W3",
"/wd4005", # macro-redefinition
"/wd4068", # unknown pragma
"/wd4180", # qualifier applied to function type has no meaning; ignored
"/wd4244", # conversion from 'type1' to 'type2', possible loss of data
"/wd4267", # conversion from 'size_t' to 'type', possible loss of data
# forcing value to bool 'true' or 'false' (performance warning)
"/wd4800",
"/DNOMINMAX", # Don't define min and max macros (windows.h)
# Don't bloat namespace with incompatible winsock versions.
"/DWIN32_LEAN_AND_MEAN",
# Don't warn about usage of insecure C functions.
"/D_CRT_SECURE_NO_WARNINGS",
"/D_SCL_SECURE_NO_WARNINGS",
# Introduced in VS 2017 15.8, allow overaligned types in aligned_storage
"/D_ENABLE_EXTENDED_ALIGNED_STORAGE",
],
"MSVC_TEST_FLAGS": [
"/wd4018", # signed/unsigned mismatch
"/wd4101", # unreferenced local variable
"/wd4503", # decorated name length exceeded, name was truncated
],
"MSVC_EXCEPTIONS_FLAGS": [
"/U_HAS_EXCEPTIONS", "/D_HAS_EXCEPTIONS=1", "/EHsc"
]
}