Warning suppression pragmas
Ben Gamari
ben at smart-cactus.org
Thu Dec 3 12:16:51 UTC 2015
Эдгар Жаворонков <edzhavoronkov at gmail.com> writes:
> Hello devs!
>
> I am trying to implement some kind of local warnings suppresion and i need
> some help.
>
> I want to use a pragma to mark functions so compiler won't throw warnings
> from them. I defined my pragma in lexer, parser and added type signature in
> HsBinds.hs. And i am stuck. I don't know what to do. What should i consider
> doing further?
>
I think it would be helpful to focus on further elaborating the
specification before we move into the implementation. There are still a
number of open questions about the design that the wiki page doesn't yet
address.
For instance, you should explicitly specify,
* What are the identifiers that appear after the `SUPPRESS` token?
* What exactly does the pragma apply to? For instance, if I have a case
like,
hello :: Int -> Int
{-# SUPPRESS some-warning #-}
helloAgain :: Type -> AnotherType
hello = (+1)
helloAgain = error "42"
or even just
hello = (+1)
{-# SUPPRESS another-warning #-}
helloAgain = error "oops"
What do you expect to happen? The behavior of the pragma in both of
these cases should be unambiguously stated in the specification.
* An concrete use-case motivating the change (preferably with examples
showing how the proposed syntax would address the motivation)
I know this sounds repetitive, but the act of writing down a proposal
will help you immensely when you do move on to implementing your ideas.
Thanks for your persistence.
Cheers,
- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151203/4c4877a0/attachment.sig>
More information about the ghc-devs
mailing list