From f92dd77cd9555984823cb45ca4b5bf78eebd2444 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 6 May 2010 13:09:10 +0000 Subject: [PATCH] Give a better deprecated message for INCLUDE pragmas; fixes #3933 We now have a DeprecatedFullText constructor, so we can override the "-#include is deprecated: " part of the warning. --- compiler/main/CmdLineParser.hs | 6 +++++- compiler/main/DynFlags.hs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs index dfe756b..f6b887e 100644 --- a/compiler/main/CmdLineParser.hs +++ b/compiler/main/CmdLineParser.hs @@ -32,7 +32,9 @@ data Flag m = Flag flagDeprecated :: Deprecated -- is the flag deprecated? } -data Deprecated = Supported | Deprecated String +data Deprecated = Supported + | Deprecated String + | DeprecatedFullText String data OptKind m -- Suppose the flag is -f = NoArg (m ()) -- -f all by itself @@ -66,6 +68,8 @@ processArgs spec args = process spec args [] [] [] let warns' = case deprecated of Deprecated warning -> L loc ("Warning: " ++ dash_arg ++ " is deprecated: " ++ warning) : warns + DeprecatedFullText warning -> + L loc ("Warning: " ++ warning) : warns Supported -> warns in case processOneArg action rest arg args of Left err -> process spec args spare (L loc err : errs) warns' diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 5705bb3..86590db 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1014,7 +1014,7 @@ dynamic_flags = [ , Flag "cpp" (NoArg (setDynFlag Opt_Cpp)) Supported , Flag "F" (NoArg (setDynFlag Opt_Pp)) Supported , Flag "#include" (HasArg (addCmdlineHCInclude)) - (Deprecated "No longer has any effect") + (DeprecatedFullText "-#include and INCLUDE pragmas are deprecated: They no longer have any effect") , Flag "v" (OptIntSuffix setVerbosity) Supported ------- Specific phases -------------------------------------------- -- 1.7.10.4