Opened 11 years ago

Last modified 4 years ago

#2365 new feature request

Warn about usage of `OPTIONS_GHC -XLanguageExtension`

Reported by: igloo Owned by:
Priority: lowest Milestone:
Component: Compiler Version: 6.8.2
Keywords: Cc: claus
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: #1407, #2499 Differential Rev(s):
Wiki Page:

Description

We should warn if suspicious flags are given in OPTIONS_GHC pragmas; in particular, if any -XLanguage flag is used.

Attachments (1)

T2365.hs (102 bytes) - added by morabbin 7 years ago.
Remove irrelevant code

Download all attachments as: .zip

Change History (22)

comment:1 Changed 11 years ago by claus

Cc: claus added

Another candidate:

{-# OPTIONS_GHC -package ghc #-}

It would be even nicer, of course, if that actually worked!-) This flag is neither static (it works in GHCi) nor dynamic (it doesn't work in a pragma) and the former makes me wonder whether the latter couldn't work as well?

comment:3 Changed 11 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 11 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:5 Changed 11 years ago by igloo

Milestone: 6.10 branch6.12 branch

comment:6 Changed 9 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:7 Changed 9 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:8 Changed 9 years ago by igloo

Milestone: 7.0.17.0.2

comment:9 Changed 9 years ago by igloo

Milestone: 7.0.27.2.1

comment:10 Changed 8 years ago by igloo

Milestone: 7.2.17.4.1

comment:11 Changed 8 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:12 Changed 7 years ago by igloo

Milestone: 7.6.17.6.2

comment:13 Changed 7 years ago by morabbin

Type of failure: None/Unknown

7.6.1 disallows -package but accepts -X''extension'':

Orac:~/work/tickets $ ghc -c T2365.hs

T2365.hs:1:16:
    unknown flag in  {-# OPTIONS_GHC #-} pragma: -package

Changed 7 years ago by morabbin

Attachment: T2365.hs added

Remove irrelevant code

comment:14 Changed 7 years ago by morabbin

comment:15 Changed 5 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:16 Changed 5 years ago by thomie

Summary: Warn about suspicious flags in OPTIONS_GHC pragmasWarn about usage of `OPTIONS_GHC -XLanguageExtension`

Warnings for {-# OPTIONS_GHC -package foo #-} were added in #2499.

This ticket is for showing a warning when {-# OPTIONS_GHC -XLanguageExtension #-} is used. The user guide says: "The LANGUAGE pragma should be used instead of OPTIONS_GHC, if possible."

comment:17 Changed 5 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:18 Changed 5 years ago by thoughtpolice

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:19 Changed 4 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:20 Changed 4 years ago by thomie

Type of failure: None/UnknownIncorrect warning at compile-time

comment:21 Changed 4 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.