#2847: Failure on OPTION_* pramgas other than GHC
---------------------------------+------------------------------------------
Reporter: NeilMitchell | Owner:
Type: bug | Status: new
Priority: high | Milestone: 6.10.2
Component: Compiler | Version: 6.10.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by simonmar):
Replying to [comment:7 igloo]:
> Replying to [comment:6 duncan]:
> > See `ghc/compiler/parser/Lexer.x` line 267:
> >
> > {{{
> > "{-#" $whitechar*
(OPTIONS_HUGS|options_hugs|OPTIONS_NHC98|options_nhc98|OPTIONS_JHC|options_jhc|CFILES|cfiles)
> > }}}
> >
> > Clearly this is not the right approach.
>
> We need this to be able to warn about unrecognised pragmas.
>
> But we also need to not parse `OPTIONS_foo` as an `OPTIONS` pragma, so
we don't try to treat `_foo` and the pragma contents as a flag.
Right, all the pragmas should require whitespace after the pragma name.
I find it strange that `OPTIONS_HUGS` is not an unrecognised pragma, but
`OPTIONS_YHC` is, surely we should be consistent here, where the only
consistent thing to do is treat them both as unrecognised from the point
of view of GHC. I can see that this might cause difficulties for people
who want to use `-Werror -Wall` and use compiler-specific pragmas, though.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2847#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs