File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -364,12 +364,25 @@ injectCode (Just (AlexPn _ ln _,code)) filename hdl = do
364
364
hPutStrLn hdl code
365
365
366
366
optsToInject :: Target -> [CLIFlags ] -> [String ]
367
- optsToInject target _ = optNoWarnings : " {-# LANGUAGE CPP #-}" : case target of
368
- GhcTarget -> [" {-# LANGUAGE MagicHash #-}" ]
369
- _ -> []
367
+ optsToInject target _ = concat
368
+ [ optNoWarnings
369
+ , [ " {-# LANGUAGE CPP #-}" ]
370
+ , [ " {-# LANGUAGE MagicHash #-}" | target == GhcTarget ]
371
+ ]
370
372
371
- optNoWarnings :: String
372
- optNoWarnings = " {-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-missing-signatures #-}"
373
+ -- List here all harmless warnings caused by Alex-generated code.
374
+ --
375
+ -- These will be suppressed so that they are not printed
376
+ -- when users turn on @-Wall@ in their lexer project.
377
+ --
378
+ optNoWarnings :: [String ]
379
+ optNoWarnings =
380
+ map ((" {-# OPTIONS_GHC -fno-warn-" ++ ) . (++ " #-}" ))
381
+ [ " missing-signatures"
382
+ , " tabs"
383
+ , " unused-binds"
384
+ , " unused-imports"
385
+ ]
373
386
374
387
importsToInject :: Target -> [CLIFlags ] -> String
375
388
importsToInject _ cli = always_imports ++ debug_imports ++ glaexts_import
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ GHC_SHIPS_WITH_TEXT:=$(shell if [ $(GHC_MAJOR_VERSION) -gt 8 -o $(GHC_MAJOR_VERS
39
39
# Turn off x-partial warning (new in GHC 9.8)
40
40
WARNS_DEP_GHC_GTEQ_9_8: =$(shell if [ $(GHC_MAJOR_VERSION ) -gt 9 -o $(GHC_MAJOR_VERSION ) -ge 9 -a $(GHC_MINOR_VERSION ) -ge 8 ]; then echo "-Wno-x-partial"; fi)
41
41
42
- HC_OPTS =-Wall $(WARNS_DEP_GHC_GTEQ_9_8 ) -fwarn-incomplete-uni-patterns -fno-warn-missing-signatures -fno-warn-unused-imports -fno-warn-tabs - Werror
42
+ HC_OPTS =-Wall $(WARNS_DEP_GHC_GTEQ_9_8 ) -fwarn-incomplete-uni-patterns -Werror
43
43
44
44
.PRECIOUS : % .n.hs % .g.hs % .o % .exe % .bin
45
45
You can’t perform that action at this time.
0 commit comments