[GHC] #9037: Add option to make selected warnings errors

#9037: Add option to make selected warnings errors ------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- It would be great if GHC offered a `-ferror-*` flag for every `-fwarn-*` flag, that turns the given type of warning into an error. For example, I would like to always error on uninitialized record fields, but don't want to go full `-Werror`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9037 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9037: Add option to make selected warnings errors -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by schyler): The rust compiler has a nice system where you don't need tons and tons of flags for warnings/errors/ignores. For example: {{{ Kyles-iMac:~ kvanb$ rustc -W Available lint options: -W <foo> Warn about <foo> -A <foo> Allow <foo> -D <foo> Deny <foo> -F <foo> Forbid <foo> (deny, and deny all overrides) Available lint checks: name default meaning ---- ------- ------- non-camel-case-types allow types, variants and traits should have camel case names managed-heap-memory allow use of managed (@ type) heap memory owned-heap-memory allow use of owned (~ type) heap memory unstable allow detects use of #[unstable] items (incl. items with no stability attribute) heap-memory allow use of any (~ type or @ type) heap memory unnecessary-qualification allow detects unnecessarily qualified names non-uppercase-statics allow static constants should have uppercase identifiers missing-doc allow detects missing documentation for public members unsafe-block allow usage of an `unsafe` block unreachable-code warn detects unreachable code deprecated warn detects use of #[deprecated] items unused-imports warn imports that are never used warnings warn mass-change the level for lints which produce warnings path-statement warn path statements with no effect ctypes warn proper use of std::libc types in foreign modules dead-assignment warn detect assignments that will never be read unused-unsafe warn unnecessary use of an `unsafe` block unused-mut warn detect mut variables which don't need to be mutable non-uppercase-pattern-statics warn static constants in match patterns should be all caps unrecognized-lint warn unrecognized lint attribute unused-variable warn detect variables which are not used in any way dead-code warn detect piece of code that will never be used unnecessary-allocation warn detects unnecessary allocations that can be eliminated attribute-usage warn detects bad use of attributes type-overflow warn literal out of range for its type type-limits warn comparisons made useless by limits of the types involved while-true warn suggest using loop { } instead of while(true) { } experimental warn detects use of #[experimental] items unknown-features deny unknown features found in create-level #[feature] directives }}} Maybe a long term goal might be to build something similar-ish. Just a thought. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9037#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9037: Add option to make selected warnings errors -------------------------------------+------------------------------------ Reporter: nh2 | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by schyler): * cc: schyler (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9037#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9037: Add option to make selected warnings errors -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): Fwiw, this is related to Design/Warnings which proposes to use `-Werror =redundant-imports` to selectively promote some warnings to errors. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9037#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9037: Add option to make selected warnings errors -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11219 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => duplicate * related: => #11219 Comment: There is a new ticket for this now: #11219. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9037#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC