Skip to content

Commit

Permalink
Merge pull request #446 from jhrcek/GHC-42044
Browse files Browse the repository at this point in the history
Document GHC-42044
  • Loading branch information
BinderDavid authored Jul 13, 2023
2 parents e22a9ac + da2a168 commit f822461
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_HUGS #-}
module UnrecognisedPragmas where

x :: Int
x = 42
{-# INLINE x #-}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{-# LANGUGE BangPatterns #-}
-- ^ missing A
{-# OPTION_HUGS #-}
-- ^ missing S
module UnrecognisedPragmas where

x :: Int
x = 42
{-# INLNE x #-}
-- ^ missing I

29 changes: 29 additions & 0 deletions message-index/messages/GHC-42044/example1/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Misspelled pragmas
---

Typos in pragma names leads to warnings being emitted. Fixing the typos makes the warnings go away.

## Error Message
```
UnrecognisedPragmas.hs:1:1: warning: [GHC-42044] [-Wunrecognised-pragmas]
Unrecognised pragma: LANGUGE
Suggested fix: Perhaps you meant ‘LANGUAGE’
|
1 | {-# LANGUGE BangPatterns #-}
| ^^^^^^^^^^^
UnrecognisedPragmas.hs:3:1: warning: [GHC-42044] [-Wunrecognised-pragmas]
Unrecognised pragma: OPTION_HUGS
Suggested fix: Perhaps you meant ‘OPTIONS_HUGS’
|
3 | {-# OPTION_HUGS #-}
| ^^^^^^^^^^^^^^^
UnrecognisedPragmas.hs:9:1: warning: [GHC-42044] [-Wunrecognised-pragmas]
Unrecognised pragma: INLNE
Suggested fix: Perhaps you meant ‘INLINE’
|
9 | {-# INLNE x #-}
| ^^^^^^^^^
```
11 changes: 11 additions & 0 deletions message-index/messages/GHC-42044/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Unrecognised pragma
summary: GHC didn't recognize pragma and will thus ignore it
severity: warning
flag: -Wunrecognised-pragmas
introduced: 9.6.1
---

GHC emits a warning whenever it encounters a pragma which it doesn't recognize. In these cases it just ignores the pragma, which might not be what you want.

This can indicate a typo in the name of the pragma, in which case fixing the typo should make the warning go away. See the GHC User Guide for a list of [supported pragmas](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/pragmas.html).

0 comments on commit f822461

Please sign in to comment.