a79c3a89205228745ebbd83f9f5795dd65ee8caa
[ghc.git] / utils / mkUserGuidePart / Options / Warnings.hs
1 module Options.Warnings where
2
3 import Types
4
5 warningsOptions :: [Flag]
6 warningsOptions =
7 [ flag { flagName = "-W"
8 , flagDescription = "enable normal warnings"
9 , flagType = DynamicFlag
10 , flagReverse = "-w"
11 }
12 , flag { flagName = "-w"
13 , flagDescription = "disable all warnings"
14 , flagType = DynamicFlag
15 }
16 , flag { flagName = "-Wall"
17 , flagDescription =
18 "enable almost all warnings (details in :ref:`options-sanity`)"
19 , flagType = DynamicFlag
20 , flagReverse = "-w"
21 }
22 , flag { flagName = "-Werror"
23 , flagDescription = "make warnings fatal"
24 , flagType = DynamicFlag
25 , flagReverse = "-Wwarn"
26 }
27 , flag { flagName = "-Wwarn"
28 , flagDescription = "make warnings non-fatal"
29 , flagType = DynamicFlag
30 , flagReverse = "-Werror"
31 }
32 , flag { flagName = "-fdefer-type-errors"
33 , flagDescription =
34 "Turn type errors into warnings, :ref:`deferring the error until "++
35 "runtime <defer-type-errors>`. Implies ``-fdefer-typed-holes``. "++
36 "See also ``-fwarn-deferred-type-errors``"
37 , flagType = DynamicFlag
38 , flagReverse = "-fno-defer-type-errors"
39 }
40 , flag { flagName = "-fdefer-typed-holes"
41 , flagDescription =
42 "Convert :ref:`typed hole <typed-holes>` errors into warnings, "++
43 ":ref:`deferring the error until runtime <defer-type-errors>`. "++
44 "Implied by ``-fdefer-type-errors``. "++
45 "See also ``-fwarn-typed-holes``."
46 , flagType = DynamicFlag
47 , flagReverse = "-fno-defer-typed-holes"
48 }
49 , flag { flagName = "-fhelpful-errors"
50 , flagDescription = "Make suggestions for mis-spelled names."
51 , flagType = DynamicFlag
52 , flagReverse = "-fno-helpful-errors"
53 }
54 , flag { flagName = "-fwarn-deprecated-flags"
55 , flagDescription =
56 "warn about uses of commandline flags that are deprecated"
57 , flagType = DynamicFlag
58 , flagReverse = "-fno-warn-deprecated-flags"
59 }
60 , flag { flagName = "-fwarn-duplicate-constraints"
61 , flagDescription =
62 "warn when a constraint appears duplicated in a type signature"
63 , flagType = DynamicFlag
64 , flagReverse = "-fno-warn-duplicate-constraints"
65 }
66 , flag { flagName = "-fwarn-duplicate-exports"
67 , flagDescription = "warn when an entity is exported multiple times"
68 , flagType = DynamicFlag
69 , flagReverse = "-fno-warn-duplicate-exports"
70 }
71 , flag { flagName = "-fwarn-hi-shadowing"
72 , flagDescription =
73 "warn when a ``.hi`` file in the current directory shadows a library"
74 , flagType = DynamicFlag
75 , flagReverse = "-fno-warn-hi-shadowing"
76 }
77 , flag { flagName = "-fwarn-identities"
78 , flagDescription =
79 "warn about uses of Prelude numeric conversions that are probably "++
80 "the identity (and hence could be omitted)"
81 , flagType = DynamicFlag
82 , flagReverse = "-fno-warn-identities"
83 }
84 , flag { flagName = "-fwarn-implicit-prelude"
85 , flagDescription = "warn when the Prelude is implicitly imported"
86 , flagType = DynamicFlag
87 , flagReverse = "-fno-warn-implicit-prelude"
88 }
89 , flag { flagName = "-fwarn-incomplete-patterns"
90 , flagDescription = "warn when a pattern match could fail"
91 , flagType = DynamicFlag
92 , flagReverse = "-fno-warn-incomplete-patterns"
93 }
94 , flag { flagName = "-fwarn-incomplete-uni-patterns"
95 , flagDescription =
96 "warn when a pattern match in a lambda expression or "++
97 "pattern binding could fail"
98 , flagType = DynamicFlag
99 , flagReverse = "-fno-warn-incomplete-uni-patterns"
100 }
101 , flag { flagName = "-fwarn-incomplete-record-updates"
102 , flagDescription = "warn when a record update could fail"
103 , flagType = DynamicFlag
104 , flagReverse = "-fno-warn-incomplete-record-updates"
105 }
106 , flag { flagName = "-fwarn-lazy-unlifted-bindings"
107 , flagDescription =
108 "*(deprecated)* warn when a pattern binding looks lazy but "++
109 "must be strict"
110 , flagType = DynamicFlag
111 , flagReverse = "-fno-warn-lazy-unlifted-bindings"
112 }
113 , flag { flagName = "-fwarn-missing-fields"
114 , flagDescription = "warn when fields of a record are uninitialised"
115 , flagType = DynamicFlag
116 , flagReverse = "-fno-warn-missing-fields"
117 }
118 , flag { flagName = "-fwarn-missing-import-lists"
119 , flagDescription =
120 "warn when an import declaration does not explicitly list all the"++
121 "names brought into scope"
122 , flagType = DynamicFlag
123 , flagReverse = "-fnowarn-missing-import-lists"
124 }
125 , flag { flagName = "-fwarn-missing-methods"
126 , flagDescription = "warn when class methods are undefined"
127 , flagType = DynamicFlag
128 , flagReverse = "-fno-warn-missing-methods"
129 }
130 , flag { flagName = "-fwarn-missing-signatures"
131 , flagDescription = "warn about top-level functions without signatures"
132 , flagType = DynamicFlag
133 , flagReverse = "-fno-warn-missing-signatures"
134 }
135 , flag { flagName = "-fwarn-missing-exported-sigs"
136 , flagDescription =
137 "warn about top-level functions without signatures, only if they "++
138 "are exported. takes precedence over -fwarn-missing-signatures"
139 , flagType = DynamicFlag
140 , flagReverse = "-fno-warn-missing-exported-sigs"
141 }
142 , flag { flagName = "-fwarn-missing-local-sigs"
143 , flagDescription =
144 "warn about polymorphic local bindings without signatures"
145 , flagType = DynamicFlag
146 , flagReverse = "-fno-warn-missing-local-sigs"
147 }
148 , flag { flagName = "-fwarn-monomorphism-restriction"
149 , flagDescription = "warn when the Monomorphism Restriction is applied"
150 , flagType = DynamicFlag
151 , flagReverse = "-fno-warn-monomorphism-restriction"
152 }
153 , flag { flagName = "-fwarn-name-shadowing"
154 , flagDescription = "warn when names are shadowed"
155 , flagType = DynamicFlag
156 , flagReverse = "-fno-warn-name-shadowing"
157 }
158 , flag { flagName = "-fwarn-orphans, -fwarn-auto-orphans"
159 , flagDescription =
160 "warn when the module contains :ref:`orphan instance declarations "++
161 "or rewrite rules <orphan-modules>`"
162 , flagType = DynamicFlag
163 , flagReverse = "-fno-warn-orphans, -fno-warn-auto-orphans"
164 }
165 , flag { flagName = "-fwarn-overlapping-patterns"
166 , flagDescription = "warn about overlapping patterns"
167 , flagType = DynamicFlag
168 , flagReverse = "-fno-warn-overlapping-patterns"
169 }
170 , flag { flagName = "-fwarn-tabs"
171 , flagDescription = "warn if there are tabs in the source file"
172 , flagType = DynamicFlag
173 , flagReverse = "-fno-warn-tabs"
174 }
175 , flag { flagName = "-fwarn-type-defaults"
176 , flagDescription = "warn when defaulting happens"
177 , flagType = DynamicFlag
178 , flagReverse = "-fno-warn-type-defaults"
179 }
180 , flag { flagName = "-fwarn-unrecognised-pragmas"
181 , flagDescription =
182 "warn about uses of pragmas that GHC doesn't recognise"
183 , flagType = DynamicFlag
184 , flagReverse = "-fno-warn-unrecognised-pragmas"
185 }
186 , flag { flagName = "-fwarn-unticked-promoted-constructors"
187 , flagDescription = "warn if promoted constructors are not ticked"
188 , flagType = DynamicFlag
189 , flagReverse = "-fno-warn-unticked-promoted-constructors"
190 }
191 , flag { flagName = "-fwarn-unused-binds"
192 , flagDescription =
193 "warn about bindings that are unused. Alias for "++
194 "``-fwarn-unused-top-binds``, ``-fwarn-unused-local-binds`` and "++
195 "``-fwarn-unused-pattern-binds``"
196 , flagType = DynamicFlag
197 , flagReverse = "-fno-warn-unused-binds"
198 }
199 , flag { flagName = "-fwarn-unused-top-binds"
200 , flagDescription = "warn about top-level bindings that are unused"
201 , flagType = DynamicFlag
202 , flagReverse = "-fno-warn-unused-top-binds"
203 }
204 , flag { flagName = "-fwarn-unused-local-binds"
205 , flagDescription = "warn about local bindings that are unused"
206 , flagType = DynamicFlag
207 , flagReverse = "-fno-warn-unused-local-binds"
208 }
209 , flag { flagName = "-fwarn-unused-pattern-binds"
210 , flagDescription = "warn about pattern match bindings that are unused"
211 , flagType = DynamicFlag
212 , flagReverse = "-fno-warn-unused-pattern-binds"
213 }
214 , flag { flagName = "-fwarn-unused-imports"
215 , flagDescription = "warn about unnecessary imports"
216 , flagType = DynamicFlag
217 , flagReverse = "-fno-warn-unused-imports"
218 }
219 , flag { flagName = "-fwarn-unused-matches"
220 , flagDescription = "warn about variables in patterns that aren't used"
221 , flagType = DynamicFlag
222 , flagReverse = "-fno-warn-unused-matches"
223 }
224 , flag { flagName = "-fwarn-unused-do-bind"
225 , flagDescription =
226 "warn about do bindings that appear to throw away values of types "++
227 "other than ``()``"
228 , flagType = DynamicFlag
229 , flagReverse = "-fno-warn-unused-do-bind"
230 }
231 , flag { flagName = "-fwarn-wrong-do-bind"
232 , flagDescription =
233 "warn about do bindings that appear to throw away monadic values "++
234 "that you should have bound instead"
235 , flagType = DynamicFlag
236 , flagReverse = "-fno-warn-wrong-do-bind"
237 }
238 , flag { flagName = "-fwarn-unsafe"
239 , flagDescription =
240 "warn if the module being compiled is regarded to be unsafe. "++
241 "Should be used to check the safety status of modules when using "++
242 "safe inference. Works on all module types, even those using "++
243 "explicit :ref:`Safe Haskell <safe-haskell>` modes (such as "++
244 "``-XTrustworthy``) and so can be used to have the compiler check "++
245 "any assumptions made."
246 , flagType = DynamicFlag
247 , flagReverse = "-fno-warn-unsafe"
248 }
249 , flag { flagName = "-fwarn-safe"
250 , flagDescription =
251 "warn if the module being compiled is regarded to be safe. Should "++
252 "be used to check the safety status of modules when using safe "++
253 "inference. Works on all module types, even those using explicit "++
254 ":ref:`Safe Haskell <safe-haskell>` modes (such as "++
255 "``-XTrustworthy``) and so can be used to have the compiler check "++
256 "any assumptions made."
257 , flagType = DynamicFlag
258 , flagReverse = "-fno-warn-safe"
259 }
260 , flag { flagName = "-fwarn-trustworthy-safe"
261 , flagDescription =
262 "warn if the module being compiled is marked as ``-XTrustworthy`` "++
263 "but it could instead be marked as ``-XSafe``, a more informative "++
264 "bound. Can be used to detect once a Safe Haskell bound can be "++
265 "improved as dependencies are updated."
266 , flagType = DynamicFlag
267 , flagReverse = "-fno-warn-safe"
268 }
269 , flag { flagName = "-fwarn-warnings-deprecations"
270 , flagDescription =
271 "warn about uses of functions & types that have warnings or "++
272 "deprecated pragmas"
273 , flagType = DynamicFlag
274 , flagReverse = "-fno-warn-warnings-deprecations"
275 }
276 , flag { flagName = "-fwarn-amp"
277 , flagDescription =
278 "*(deprecated)* warn on definitions conflicting with the "++
279 "Applicative-Monad Proposal (AMP)"
280 , flagType = DynamicFlag
281 , flagReverse = "-fno-warn-amp"
282 }
283 , flag { flagName = "-fwarn-deferred-type-errors"
284 , flagDescription =
285 "Report warnings when :ref:`deferred type errors "++
286 "<defer-type-errors>` are enabled. This option is enabled by "++
287 "default. See ``-fdefer-type-errors``."
288 , flagType = DynamicFlag
289 , flagReverse = "-fno-warn-deferred-type-errors"
290 }
291 , flag { flagName = "-fwarn-typed-holes"
292 , flagDescription =
293 "Report warnings when :ref:`typed hole <typed-holes>` errors are "++
294 ":ref:`deferred until runtime <defer-type-errors>`. See "++
295 "``-fdefer-typed-holes``."
296 , flagType = DynamicFlag
297 , flagReverse = "-fno-warn-typed-holes"
298 }
299 , flag { flagName = "-fwarn-partial-type-signatures"
300 , flagDescription =
301 "warn about holes in partial type signatures when "++
302 "``-XPartialTypeSignatures`` is enabled. Not applicable when "++
303 "``-XPartialTypesignatures`` is not enabled, in which case errors "++
304 "are generated for such holes. See :ref:`partial-type-signatures`."
305 , flagType = DynamicFlag
306 , flagReverse = "-fno-warn-partial-type-signatures"
307 }
308 , flag { flagName = "-fwarn-deriving-typeable"
309 , flagDescription =
310 "warn when encountering a request to derive an instance of class "++
311 "``Typeable``. As of GHC 7.10, such declarations are unnecessary "++
312 "and are ignored by the compiler because GHC has a custom solver "++
313 "for discharging this type of constraint."
314 , flagType = DynamicFlag
315 , flagReverse = "-fno-warn-deriving-typeable"
316 }
317 ]