Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused -XCPP #10723

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

philderbeast
Copy link
Collaborator

@philderbeast philderbeast commented Jan 7, 2025

Fixes #10720, a follow on from #10092. Removes unused {-# LANGUAGE CPP #-} pragmas.


Template B: This PR does not modify behaviour or interface

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Manual QA Notes

Please delete dist-newstyle and run the following to check for occurrences of unused -XCPP:

$ grep '^#if' --files-without-match $(grep -R --files-with-matches 'LANGUAGE.*CPP' */**/*.hs)
cabal-testsuite/PackageTests/Backpack/bkpcabal01/p/P.hs
cabal-testsuite/PackageTests/CabalMacros/Mdl.hs
cabal-testsuite/PackageTests/CmmSources/src/Demo.hs
cabal-testsuite/PackageTests/CmmSourcesDyn/demo/Main.hs
cabal-testsuite/PackageTests/CmmSourcesDyn/src/Demo.hs
cabal-testsuite/PackageTests/CmmSourcesExe/src/Demo.hs
cabal-testsuite/PackageTests/Haddock/CPP.hs
cabal-testsuite/PackageTests/PreProcess/Hsc2HsOptionsCC/Main.hs
cabal-testsuite/PackageTests/Regression/T5386/Foo.hs
Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs

$ grep 'LANGUAGE CPP' Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
    tell "{-# LANGUAGE CPP #-}\n"

Those in cabal-testsuite/PackageTests are part of tests so should likely stay put and Distribution.Simple.Build.PathsModule.Z is generating a paths module using a zinza template. It's a false positive find with the unrefined grep pattern, LANGUAGE.*CPP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modules enabling -XCPP but not needing it
2 participants