Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
3e314cc2
Commit
3e314cc2
authored
Apr 24, 2012
by
Ian Lynagh
Browse files
Add a flag for the unsupported calling convention warning
parent
ddc7f758
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
3e314cc2
...
...
@@ -357,6 +357,7 @@ data WarningFlag =
|
Opt_WarnUnsafe
|
Opt_WarnSafe
|
Opt_WarnPointlessPragmas
|
Opt_WarnUnsupportedCallingConventions
deriving
(
Eq
,
Show
,
Enum
)
data
Language
=
Haskell98
|
Haskell2010
...
...
@@ -1842,7 +1843,8 @@ fWarningFlags = [
(
"warn-alternative-layout-rule-transitional"
,
Opt_WarnAlternativeLayoutRuleTransitional
,
nop
),
(
"warn-unsafe"
,
Opt_WarnUnsafe
,
setWarnUnsafe
),
(
"warn-safe"
,
Opt_WarnSafe
,
setWarnSafe
),
(
"warn-pointless-pragmas"
,
Opt_WarnPointlessPragmas
,
nop
)
]
(
"warn-pointless-pragmas"
,
Opt_WarnPointlessPragmas
,
nop
),
(
"warn-unsupported-calling-conventions"
,
Opt_WarnUnsupportedCallingConventions
,
nop
)
]
-- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@
fFlags
::
[
FlagSpec
DynFlag
]
...
...
@@ -2174,7 +2176,8 @@ standardWarnings
Opt_WarnDodgyForeignImports
,
Opt_WarnWrongDoBind
,
Opt_WarnAlternativeLayoutRuleTransitional
,
Opt_WarnPointlessPragmas
Opt_WarnPointlessPragmas
,
Opt_WarnUnsupportedCallingConventions
]
minusWOpts
::
[
WarningFlag
]
...
...
compiler/typecheck/TcForeign.lhs
View file @
3e314cc2
...
...
@@ -48,6 +48,8 @@ import Platform
import SrcLoc
import Bag
import FastString
import Control.Monad
\end{code}
\begin{code}
...
...
@@ -454,7 +456,8 @@ checkCConv StdCallConv = do dflags <- getDynFlags
if platformArch platform == ArchX86
then return StdCallConv
else do -- This is a warning, not an error. see #3336
addWarnTc (text "the 'stdcall' calling convention is unsupported on this platform," $$ text "treating as ccall")
when (wopt Opt_WarnUnsupportedCallingConventions dflags) $
addWarnTc (text "the 'stdcall' calling convention is unsupported on this platform," $$ text "treating as ccall")
return CCallConv
checkCConv PrimCallConv = do addErrTc (text "The `prim' calling convention can only be used with `foreign import'")
return PrimCallConv
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment