diff options
Diffstat (limited to '.travis/flags-clang.sh')
-rw-r--r-- | .travis/flags-clang.sh | 62 |
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. | ||
6 | add_flag -Wall | ||
7 | add_flag -Wextra | ||
8 | add_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. | ||
13 | add_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. | ||
16 | add_flag -Wno-conversion | ||
17 | # TODO(iphydf): Check enum values when received from the user, then assume | ||
18 | # correctness and remove this suppression. | ||
19 | add_flag -Wno-covered-switch-default | ||
20 | # Due to clang's tolower() macro being recursive | ||
21 | # https://github.com/TokTok/c-toxcore/pull/481 | ||
22 | add_flag -Wno-disabled-macro-expansion | ||
23 | # We don't put __attribute__ on the public API. | ||
24 | add_flag -Wno-documentation-deprecated-sync | ||
25 | # Bootstrap daemon does this. | ||
26 | add_flag -Wno-format-nonliteral | ||
27 | # struct Foo foo = {0}; is a common idiom. | ||
28 | add_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. | ||
31 | add_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). | ||
34 | add_flag -Wno-reserved-id-macro | ||
35 | # TODO(iphydf): Clean these up. They are likely not bugs, but still | ||
36 | # potential issues and probably confusing. | ||
37 | add_flag -Wno-sign-compare | ||
38 | # Our use of mutexes results in a false positive, see 1bbe446. | ||
39 | add_flag -Wno-thread-safety-analysis | ||
40 | # File transfer code has this. | ||
41 | add_flag -Wno-type-limits | ||
42 | # Callbacks often don't use all their parameters. | ||
43 | add_flag -Wno-unused-parameter | ||
44 | # libvpx uses __attribute__((unused)) for "potentially unused" static | ||
45 | # functions to avoid unused static function warnings. | ||
46 | add_flag -Wno-used-but-marked-unused | ||
47 | # We use variable length arrays a lot. | ||
48 | add_flag -Wno-vla | ||
49 | |||
50 | # Disable specific warning flags for C++. | ||
51 | |||
52 | # Comma at end of enum is supported everywhere we run. | ||
53 | add_cxx_flag -Wno-c++98-compat-pedantic | ||
54 | # TODO(iphydf): Stop using flexible array members. | ||
55 | add_cxx_flag -Wno-c99-extensions | ||
56 | # We're C-compatible, so use C style casts. | ||
57 | add_cxx_flag -Wno-old-style-cast | ||
58 | |||
59 | # Downgrade to warning so we still see it. | ||
60 | add_flag -Wno-error=documentation-unknown-command | ||
61 | add_flag -Wno-error=unreachable-code | ||
62 | add_flag -Wno-error=unused-variable | ||