[GHC] #10752: Print which warning-flag controls/enabled an emitted warning
GHC
ghc-devs at haskell.org
Fri Aug 7 08:26:39 UTC 2015
#10752: Print which warning-flag controls/enabled an emitted warning
-------------------------------------+-------------------------------------
Reporter: hvr | Owner:
Type: feature | Status: new
request |
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.10.2
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
Both `gcc` and `clang` tell which warning flag a reported warning can be
controlled with, e.g.
{{{
$ clang-3.5 -Wall -c hello.c
hello.c:3:7: warning: unused variable 'x' [-Wunused-variable]
int x;
^
1 warning generated.
}}}
{{{
$ gcc -Wall -c hello.c
hello.c: In function ‘main’:
hello.c:3:7: warning: unused variable ‘x’ [-Wunused-variable]
int x;
^
hello.c:4:1: warning: control reaches end of non-void function [-Wreturn-
type]
}
^
}}}
With GHC however, we need to lookup the documentation (or memorise all
warning flags) to find out which `-fno-warn-*` flag we need to use to
silence a specific warning.
I propose we augment GHC's warnings in a similar style to how
`gcc`/`clang` report flags in compile warnings.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10752>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list