-Werror -Woverlapping-patterns -fglasgow-exts ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

-Werror -Woverlapping-patterns -fglasgow-exts ?

Johannes Waldmann-2
Dear Cafe,

I want to chase overlapping patterns in a larger code base.
So I use  -Werror -Woverlapping-patterns .

But the code also needs  -fglasgow-exts
and this makes compilation stop right at the beginning, with
"warning:   -fglasgow-exts is deprecated: ..."
which will be turned into an error because of -Werror

-Wno-warnings-deprecations does not help,
apparently that warning is not a deprecation.

Is there a way to get -Werror for specific warnings?

- J.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: -Werror -Woverlapping-patterns -fglasgow-exts ?

Johannes Waldmann-2
it seems that adding "-w" helps (turn off all warnings). - J
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: -Werror -Woverlapping-patterns -fglasgow-exts ?

David Feuer
A lot of us would like to get -Werror for only some errors. I don't
think it exists yet. But why are you still using -fglasgow-exts? If
you use LANGUAGE pragmas instead, everything should work.

David

On Tue, Feb 21, 2017 at 8:15 AM, Johannes Waldmann
<[hidden email]> wrote:
> it seems that adding "-w" helps (turn off all warnings). - J
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: -Werror -Woverlapping-patterns -fglasgow-exts ?

Johannes Waldmann-2
> But why are you still using -fglasgow-exts?

legacy code base

> If you use LANGUAGE pragmas instead ...

I'd love to - if this refactoring can be automated
(I have  2k  modules in this project :-)

- J.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: -Werror -Woverlapping-patterns -fglasgow-exts ?

Adam Bergmark-2
You can use Cabal's default-extensions field to enable extensions in all modules.


On Tue, 21 Feb 2017 at 18:29 Johannes Waldmann <[hidden email]> wrote:
> But why are you still using -fglasgow-exts?

legacy code base

> If you use LANGUAGE pragmas instead ...

I'd love to - if this refactoring can be automated
(I have  2k  modules in this project :-)

- J.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: -Werror -Woverlapping-patterns -fglasgow-exts ?

Maciej Bielecki
In reply to this post by David Feuer
On Tue, Feb 21, 2017 at 12:21:08PM -0500, David Feuer wrote:
> A lot of us would like to get -Werror for only some errors. I don't
> think it exists yet.

It's implemented in GHC HEAD: https://ghc.haskell.org/trac/ghc/ticket/11219

I'm not sure whether it supports flag deprecation warnings though.

Maciej

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: -Werror -Woverlapping-patterns -fglasgow-exts ?

David Feuer
A tool to automatically select and add (almost) only the necessary extensions to code that compiles successfully with -fglasgow-exts would be quite nice to have, especially if it could run on a whole package. The easiest thing would probably be to compile the module and then add extensions included in -fglasgow-exts based on error messages, repeating until the module compiles successfully. The included extension I'm familiar with that seems hardest to handle is ScopedTypeVariables, as that can (in some cases) change the meaning of code that compiles either way. So the easiest thing would be to just include it unconditionally.

On Feb 22, 2017 7:08 PM, "Maciej Bielecki" <[hidden email]> wrote:
On Tue, Feb 21, 2017 at 12:21:08PM -0500, David Feuer wrote:
> A lot of us would like to get -Werror for only some errors. I don't
> think it exists yet.

It's implemented in GHC HEAD: https://ghc.haskell.org/trac/ghc/ticket/11219

I'm not sure whether it supports flag deprecation warnings though.

Maciej

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.