Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport -+-- Reporter: AndreaRossato |Owner: AndreaRossato Type: bug | Status: closed Priority: normal|Milestone: 6.12.1 Component: Compiler | Version: 6.8.1 Severity: minor | Resolution: fixed Keywords:| Difficulty: Easy (1 hr) Testcase:| Os: Unknown/Multiple Architecture: Unknown/Multiple | -+-- Changes (by igloo): * status: assigned = closed * resolution: = fixed Comment: Andrea, sorry for overlooking your patch for so long; I tend not to look at bugs that are assigned to someone else. I've applied a similar patch, only using `warn-dodgy-exports` rather than `warn-misc`. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport -+-- Reporter: AndreaRossato |Owner: AndreaRossato Type: bug | Status: assigned Priority: normal|Milestone: 6.12.1 Component: Compiler | Version: 6.8.1 Severity: minor | Resolution: Keywords:| Difficulty: Easy (1 hr) Testcase:| Os: Unknown/Multiple Architecture: Unknown/Multiple | -+-- Changes (by igloo): * milestone: 6.10 branch = 6.12.1 Comment: There's a patch attached to this, so we should take a look. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by simonmar): Replying to [comment:11 AndreaRossato]: So I'm attaching a new patch, which correctly deals with the second issue. Looks fine, modulo your suggestions below. I also want to rephrase my other question about the possibility of adding more specific warnings instead of a general wanr-misc: the warning about exporting T(..) when T is a synonym is treated similarly to the warning for importing T(..) when T is exported abstractly. For this second case there is a flag: -fwarn-dodgy-imports. Shouldn't we add a corresponding -fwarn-dodgy-exports? Yes, that sounds like the right thing. Rule of thumb: if `-fwarn-misc` would only cover one or two warnings, it would be better to give them separate flags. If we can find a handful of things to put in `-fwarn-misc`, then it becomes worthwhile. This second was seems more consistent to me (obviously the patch will include all the needed documentation update too). Sorry for the noise: I'm learning. No problem, thanks for getting involved! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by NeilMitchell): In my example I initially got the above warning when compiling both module A and module B. I then added -w to each file, and the B warning went away, but not the A warning (the subject of this bug). I then modified the flags in B to be only -fno-warn-unused-imports and the warning remained off - namely that flag was suppressing the warning in module B. It would seem logical if this warning could be suppressed by either -w or -fno-warn-unused-imports My example was slightly more complicated than just module B where. I tried to reduce a test case but replacing my complicated (but non- exporting) module B with the above text removed the warning. Perhaps that is another bug? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by AndreaRossato): Hi Neil, I don't think I entirely understand your message. Here warn-unused-imports is off by default, that is to say, I need to use -fwarn-unused-imports to have the warning reported. And, more important, it's use seems to be unrelated to the nullModuleExport, which is always reported when a module exports a second module which (the second) does not export anything. To explain: 1. Module A: module A ( module B ) where import module B Module B: module B where Compiling A reports a waring: A.hs:1:11: Warning: The export item `module B' exports nothing This warning is not suppressed by -w. And it is unrelated to -fno-warn- unused-imports, since A is actually using the export. Am I missing something? Both this one and the one reported by Simon are generated by the renamer and indeed there are no checks for flags. (In the meantime I'm preparing the list of unflagged warnings and reading this wiki for preparing a patch that complies with the style and the guidelines for contributors - which is a useful reading anyhow). Andrea -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by igloo): I don't think it's at all logical for the `warn-unused-imports` flags to control a warning about empty exports. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by NeilMitchell): It may not be particularly logical, but it already does in some places! Out of all the warning flags listed in the manual, it was the one that looked most likely - but was a bit of a stretch. Perhaps you need a new warning flag, and fix up the other one as well. Or perhaps there is some flag name that encompasses both this behaviour and the obvious import one. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by AndreaRossato): I've just attached a patch, which is just a proof of concept... that I can actually take care of this ticket...;) This is just a start, since I think I need some directions here. I added the new warn-misc option, and I added it to the list of standardWarnings. I changed RnNames.lhs to use it and the bug in the title of this ticket is gone. I've also applied the same approach to the problem Simon reported above. This way the warning has been eliminated but an error is reported instead. Indeed if the exported element has the form of a type constructor (isTyConName), a warning is reported, otherwise an exportItemErr is emitted. So, I think I need, in such a case, a more sophisticated approach, which may be more invasive in the code. This is the reason why I included that change, in order to have some comments on how to deal with this kind of warnings. Another question: wouldn't it be better to add a specific warning for each of those cases? Since I'm going to do this work for (possibly) all those unflagged warnings, adding a specific flag for each of them is not going to be more burdensome. Finally, I want to investigate a bit more those strange flag interactions we were discussing above, interactions that I'm not able to reproduce, or deduce by reading the code. Sorry for taking so much time and energy for this simple bug, but since I'm a new contributor I also need to acquire all the meta knowledge to... well, contribute. Andrea -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by AndreaRossato): Maybe you have noticed that I still lack that sort of confidence with the code that would refrain me from asking some of the questions I'm asking: I must admit I feel some sort of embarrassment in dealing with the Beast. So I'm attaching a new patch, which correctly deals with the second issue. I also want to rephrase my other question about the possibility of adding more specific warnings instead of a general wanr-misc: the warning about exporting T(..) when T is a synonym is treated similarly to the warning for importing T(..) when T is exported abstractly. For this second case there is a flag: -fwarn-dodgy-imports. Shouldn't we add a corresponding -fwarn-dodgy-exports? This second was seems more consistent to me (obviously the patch will include all the needed documentation update too). Sorry for the noise: I'm learning. Andrea -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: Type: bug| Status: new Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Changes (by simonmar): * difficulty: Unknown = Easy (1 hr) * os: Linux = Multiple * architecture: x86 = Multiple * severity: normal = minor * milestone: = 6.10 branch Comment: The first option looks like the right one to me, even, as you say, if we have to add `-fwarn-misc`. This is not deep, and would make a good hacking task for a new GHC contributor... -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Changes (by AndreaRossato): * status: new = assigned * owner: = AndreaRossato Comment: I'd like to take the challenge and try to become a new GHC contributor: I'm finishing pulling the source.. :) I'd try to send a patch with the solution proposed above or report back as soon as possible. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: AndreaRossato Type: bug| Status: assigned Priority: normal | Milestone: 6.10 branch Component: Compiler |Version: 6.8.1 Severity: minor | Resolution: Keywords: | Difficulty: Easy (1 hr) Testcase: | Architecture: Multiple Os: Multiple | ---+ Comment (by simonpj): Andrea, thank you! FWIW, it should not be hard to track down all warnings. They are all produced by * The renamer * The typechecker * The desguarer All three have monads, so you should be able to find all warning emissions by looking in `TcRnMonad` and `DsMonad` for the functions that spit out a warning. Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: Type: bug| Status: new Priority: normal | Milestone: Component: Compiler |Version: 6.8.1 Severity: normal | Resolution: Keywords: | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | ---+ Changes (by simonpj): * difficulty: = Unknown Comment: Indeed. And on inspection there are quite a few other examples. e.g {{{ module F( T(..) ) where type T = Int }}} yields a warning even with `-w`. I can see two choices: * Track down all the exceptions and give them a flag, even if it's `-Wmisc`. But it may be tiresome to find every warning. OR * Make `-w` set a bit that suppresses all warnings from all causes. This is easier to implement, because it can be done in one place. The trouble with this is that `-w -fwarn-incomplete-patterns` would not warn of incomplete patterns (because the suppress-warning bit is set). How important is this? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #1911: -w doesn't turn off nullModuleExport
#1911: -w doesn't turn off nullModuleExport ---+ Reporter: AndreaRossato | Owner: Type: bug| Status: new Priority: normal | Milestone: Component: Compiler |Version: 6.8.1 Severity: normal | Keywords: Testcase: | Architecture: x86 Os: Linux | ---+ Hello! Starting from 6.8.1 ghc reports a warning when a module that does not export anything is exported. The warning is generated in compiler/rename/RnName.lhs by exports_from_avail. I'm not familiar enough with ghc to go any further. Thanks. Andrea -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1911 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs