summaryrefslogtreecommitdiff
path: root/.travis/flags-clang.sh
diff options
context:
space:
mode:
Diffstat (limited to '.travis/flags-clang.sh')
-rw-r--r--.travis/flags-clang.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/.travis/flags-clang.sh b/.travis/flags-clang.sh
new file mode 100644
index 00000000..1bca35ca
--- /dev/null
+++ b/.travis/flags-clang.sh
@@ -0,0 +1,62 @@
1#!/bin/sh
2
3. .travis/flags.sh
4
5# Add all warning flags we can.
6add_flag -Wall
7add_flag -Wextra
8add_flag -Weverything
9
10# Disable specific warning flags for both C and C++.
11
12# TODO(iphydf): Clean these up. Probably all of these are actual bugs.
13add_flag -Wno-cast-align
14# Very verbose, not very useful. This warns about things like int -> uint
15# conversions that change sign without a cast and narrowing conversions.
16add_flag -Wno-conversion
17# TODO(iphydf): Check enum values when received from the user, then assume
18# correctness and remove this suppression.
19add_flag -Wno-covered-switch-default
20# Due to clang's tolower() macro being recursive
21# https://github.com/TokTok/c-toxcore/pull/481
22add_flag -Wno-disabled-macro-expansion
23# We don't put __attribute__ on the public API.
24add_flag -Wno-documentation-deprecated-sync
25# Bootstrap daemon does this.
26add_flag -Wno-format-nonliteral
27# struct Foo foo = {0}; is a common idiom.
28add_flag -Wno-missing-field-initializers
29# Useful sometimes, but we accept padding in structs for clarity.
30# Reordering fields to avoid padding will reduce readability.
31add_flag -Wno-padded
32# This warns on things like _XOPEN_SOURCE, which we currently need (we
33# probably won't need these in the future).
34add_flag -Wno-reserved-id-macro
35# TODO(iphydf): Clean these up. They are likely not bugs, but still
36# potential issues and probably confusing.
37add_flag -Wno-sign-compare
38# Our use of mutexes results in a false positive, see 1bbe446.
39add_flag -Wno-thread-safety-analysis
40# File transfer code has this.
41add_flag -Wno-type-limits
42# Callbacks often don't use all their parameters.
43add_flag -Wno-unused-parameter
44# libvpx uses __attribute__((unused)) for "potentially unused" static
45# functions to avoid unused static function warnings.
46add_flag -Wno-used-but-marked-unused
47# We use variable length arrays a lot.
48add_flag -Wno-vla
49
50# Disable specific warning flags for C++.
51
52# Comma at end of enum is supported everywhere we run.
53add_cxx_flag -Wno-c++98-compat-pedantic
54# TODO(iphydf): Stop using flexible array members.
55add_cxx_flag -Wno-c99-extensions
56# We're C-compatible, so use C style casts.
57add_cxx_flag -Wno-old-style-cast
58
59# Downgrade to warning so we still see it.
60add_flag -Wno-error=documentation-unknown-command
61add_flag -Wno-error=unreachable-code
62add_flag -Wno-error=unused-variable