DiagnosticGroups.td revision 200583
1193326Sed//==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
2193326Sed//
3193326Sed//                     The LLVM Compiler Infrastructure
4193326Sed//
5193326Sed// This file is distributed under the University of Illinois Open Source
6193326Sed// License. See LICENSE.TXT for details.
7193326Sed//
8193326Sed//===----------------------------------------------------------------------===//
9193326Sed
10193326Seddef ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
11193326Seddef ImplicitInt : DiagGroup<"implicit-int">;
12193326Sed
13193326Sed// Aggregation warning settings.
14193326Seddef Implicit : DiagGroup<"implicit", [
15193326Sed    ImplicitFunctionDeclare,
16193326Sed    ImplicitInt
17193326Sed]>;
18193326Sed    
19193326Sed
20193326Sed
21193326Sed// Empty DiagGroups: these are recognized by clang but ignored.
22198092Srdivackydef : DiagGroup<"address">;
23193326Seddef : DiagGroup<"aggregate-return">;
24198092Srdivackydef : DiagGroup<"attributes">;
25193326Seddef : DiagGroup<"bad-function-cast">;
26198954Srdivackydef : DiagGroup<"c++-compat">;
27193326Seddef : DiagGroup<"cast-align">;
28193326Seddef : DiagGroup<"cast-qual">;
29193326Seddef : DiagGroup<"char-align">;
30193326Seddef Comment : DiagGroup<"comment">;
31199482Srdivackydef : DiagGroup<"ctor-dtor-privacy">;
32193326Seddef : DiagGroup<"declaration-after-statement">;
33193326Seddef : DiagGroup<"disabled-optimization">;
34193326Seddef : DiagGroup<"discard-qual">;
35194613Seddef : DiagGroup<"div-by-zero">;
36193380Seddef EmptyBody : DiagGroup<"empty-body">;
37193326Seddef ExtraTokens : DiagGroup<"extra-tokens">;
38193326Sed
39193326Seddef FormatExtraArgs : DiagGroup<"format-extra-args">;
40193326Seddef FormatZeroLength : DiagGroup<"format-zero-length">;
41193326Sed
42193326Seddef FourByteMultiChar : DiagGroup<"four-char-constants">;
43199482Srdivackydef : DiagGroup<"idiomatic-parentheses">;
44198092Srdivackydef : DiagGroup<"import">;
45193326Seddef : DiagGroup<"init-self">;
46193326Seddef : DiagGroup<"inline">;
47193326Seddef : DiagGroup<"int-to-pointer-cast">;
48194613Seddef : DiagGroup<"invalid-pch">;
49193326Seddef : DiagGroup<"missing-braces">;
50193326Seddef : DiagGroup<"missing-declarations">;
51193326Seddef : DiagGroup<"missing-format-attribute">;
52198954Srdivackydef : DiagGroup<"missing-include-dirs">;
53193326Seddef : DiagGroup<"missing-noreturn">;
54193326Seddef MultiChar : DiagGroup<"multichar">;
55193326Seddef : DiagGroup<"nested-externs">;
56193326Seddef : DiagGroup<"newline-eof">;
57198092Srdivackydef LongLong : DiagGroup<"long-long">;
58193326Seddef MismatchedTags : DiagGroup<"mismatched-tags">;
59193326Seddef : DiagGroup<"missing-field-initializers">;
60193326Seddef NonNull : DiagGroup<"nonnull">;
61193326Seddef : DiagGroup<"nonportable-cfstrings">;
62199482Srdivackydef : DiagGroup<"non-virtual-dtor">;
63193326Seddef : DiagGroup<"old-style-definition">;
64198092Srdivackydef : DiagGroup<"overflow">;
65198092Srdivackydef : DiagGroup<"overloaded-virtual">;
66193326Seddef : DiagGroup<"packed">;
67198092Srdivackydef PointerArith : DiagGroup<"pointer-arith">;
68193326Seddef : DiagGroup<"pointer-to-int-cast">;
69193326Seddef : DiagGroup<"redundant-decls">;
70193326Seddef ReturnType : DiagGroup<"return-type">;
71199482Srdivackydef SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
72193326Seddef : DiagGroup<"sequence-point">;
73193326Seddef : DiagGroup<"shadow">;
74193326Seddef : DiagGroup<"shorten-64-to-32">;
75199482Srdivackydef SignCompare : DiagGroup<"sign-compare">;
76199482Srdivackydef : DiagGroup<"synth">;
77193326Sed
78198092Srdivacky// Preprocessor warnings.
79198092Srdivackydef : DiagGroup<"builtin-macro-redefined">;
80198092Srdivacky
81199990Srdivacky// Just silence warnings about -Wstrict-aliasing for now.
82193326Seddef : DiagGroup<"strict-aliasing=0">;
83193326Seddef : DiagGroup<"strict-aliasing=1">;
84193326Seddef : DiagGroup<"strict-aliasing=2">;
85193326Seddef : DiagGroup<"strict-aliasing">;
86193326Sed
87199990Srdivacky// Just silence warnings about -Wstrict-overflow for now.
88193326Seddef : DiagGroup<"strict-overflow=0">;
89193326Seddef : DiagGroup<"strict-overflow=1">;
90193326Seddef : DiagGroup<"strict-overflow=2">;
91199990Srdivackydef : DiagGroup<"strict-overflow=3">;
92199990Srdivackydef : DiagGroup<"strict-overflow=4">;
93199990Srdivackydef : DiagGroup<"strict-overflow=5">;
94193326Seddef : DiagGroup<"strict-overflow">;
95193326Sed
96193326Seddef InvalidOffsetof : DiagGroup<"invalid-offsetof">;
97193326Seddef : DiagGroup<"strict-prototypes">;
98193326Seddef : DiagGroup<"strict-selector-match">;
99193326Seddef Switch         : DiagGroup<"switch">;
100193326Seddef Trigraphs : DiagGroup<"trigraphs">;
101193326Sed
102193326Seddef : DiagGroup<"type-limits">;
103193326Seddef Uninitialized  : DiagGroup<"uninitialized">;
104193326Seddef UnknownPragmas : DiagGroup<"unknown-pragmas">;
105193725Seddef UnusedArgument : DiagGroup<"unused-argument">;
106193725Seddef UnusedFunction : DiagGroup<"unused-function">;
107193725Seddef UnusedLabel : DiagGroup<"unused-label">;
108193725Seddef UnusedParameter : DiagGroup<"unused-parameter">;
109193326Seddef UnusedValue    : DiagGroup<"unused-value">;
110193326Seddef UnusedVariable : DiagGroup<"unused-variable">;
111194613Seddef ReadOnlySetterAttrs : DiagGroup<"readonly-setter-attrs">;
112198092Srdivackydef Reorder : DiagGroup<"reorder">;
113194613Seddef UndeclaredSelector : DiagGroup<"undeclared-selector">;
114198092Srdivackydef SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
115193326Seddef : DiagGroup<"variadic-macros">;
116200583Srdivackydef VariadicMacros : DiagGroup<"variadic-macros">;
117193326Seddef VectorConversions : DiagGroup<"vector-conversions">;      // clang specific
118193326Seddef VolatileRegisterVar : DiagGroup<"volatile-register-var">;
119193326Seddef : DiagGroup<"write-strings">;
120198092Srdivackydef CharSubscript : DiagGroup<"char-subscripts">;
121193326Sed
122193326Sed// Aggregation warning settings.
123193326Sed
124199482Srdivacky// -Widiomatic-parentheses contains warnings about 'idiomatic'
125199482Srdivacky// missing parentheses;  it is off by default.
126199482Srdivackydef Parentheses : DiagGroup<"parentheses", [DiagGroup<"idiomatic-parentheses">]>;
127193326Sed
128199482Srdivacky// -Wconversion has its own warnings, but we split this one out for
129199482Srdivacky// legacy reasons.
130199482Srdivackydef Conversion : DiagGroup<"conversion",
131199482Srdivacky                           [DiagGroup<"shorten-64-to-32">]>;
132199482Srdivacky
133193725Seddef Unused : DiagGroup<"unused",
134193725Sed                       [UnusedArgument, UnusedFunction, UnusedLabel,
135193725Sed                        UnusedParameter, UnusedValue, UnusedVariable]>;
136193725Sed
137193326Sed// Format settings.
138193326Seddef Format : DiagGroup<"format", [FormatExtraArgs, FormatZeroLength, NonNull]>;
139193326Seddef FormatSecurity : DiagGroup<"format-security", [Format]>;
140193326Seddef FormatNonLiteral : DiagGroup<"format-nonliteral", [FormatSecurity]>;
141193326Seddef FormatY2K : DiagGroup<"format-y2k", [Format]>;
142193326Seddef Format2 : DiagGroup<"format=2",
143193326Sed                        [FormatNonLiteral, FormatSecurity, FormatY2K]>;
144193326Sed
145194613Seddef Extra : DiagGroup<"extra", [
146199482Srdivacky    SemiBeforeMethodBody,
147199482Srdivacky    SignCompare,
148194613Sed    UnusedParameter
149194613Sed  ]>;
150193326Sed
151193326Seddef Most : DiagGroup<"most", [
152193326Sed    Comment,
153193326Sed    Format,
154193326Sed    Implicit,
155193326Sed    MismatchedTags,
156193326Sed    MultiChar,
157198092Srdivacky    ReturnType,
158193326Sed    Switch,
159193326Sed    Trigraphs,
160193326Sed    Uninitialized,
161193326Sed    UnknownPragmas,
162193326Sed    UnusedValue,
163193326Sed    UnusedVariable,
164193326Sed    VectorConversions,
165194613Sed    VolatileRegisterVar,
166198092Srdivacky    Reorder,
167198092Srdivacky    CharSubscript
168193326Sed ]>;
169193326Sed
170193326Sed// -Wall is -Wmost -Wparentheses
171193326Seddef : DiagGroup<"all", [Most, Parentheses]>;
172193326Sed
173193326Sed// Aliases.
174193326Seddef : DiagGroup<"", [Extra]>;  // -W = -Wextra
175193326Seddef : DiagGroup<"endif-labels", [ExtraTokens]>; // endif-labels = endif-tokens
176193326Sed
177199482Srdivacky// A warning group for warnings that we want to have on by default in clang,
178199482Srdivacky// but which aren't on by default in GCC.
179199482Srdivackydef NonGCC : DiagGroup<"non-gcc",
180199482Srdivacky    [SignCompare, Conversion]>;
181