Home > Software engineering >  What happens when a deprecated optimization flag is passed to GHC?
What happens when a deprecated optimization flag is passed to GHC?

Time:10-15

In my stack configuration i have a list of optimization flags that i pass to GHC normally, but i tried the latest version of GHC which deprecated one of them. During compilation GHC gave me a warning about this, but still compiled everything.

What actually happens when this occurs? Are there any consequences? Does it just ignore that flag but still pass the rest of my optimization flags?

Thanks

CodePudding user response:

When you pass an unknown flag to GHC, you'll get an error and compilation will fail.

When using a deprecated flag, on the other hand, it depends on the flag. For example, using -auto will warn you that you should use -fprof-auto-exported but it will trigger the latter anyway. It's just that maybe in a few versions of GHC, the deprecated flag will disappear. For -funfolding-keeness-factor, GHC tells us that it's no longer respected, so you can pass the flag but it should have no effect on the compilation.

  • Related