Question

I am reviewing the flags we have for our MSVC projects, and I can't get enough documentation on the following features:

  • Use Link Time Code Generation (/ltcg)
  • enable function level linking (/Gy)
  • Eliminate Unreferenced Data (/OPT:REF)
  • Remove Redundant COMDATs (/OPT:ICF)
  • optimize for windows98 No (/OPT:NOWIN98)
  • Enable string pooling (/GF)

we do use separate debug/release builds, so I'm mainly interested in flags for release. explanations about these flags and how they interelate, as well as which ones you use in your own projects are very welcome!

Was it helpful?

Solution

To a large extent it depends on what you are looking for from your build, for example whether you have seperate release and debug builds as discussed here. If you have a combined debug/release build you will need function level linking in order to use edit and continue in the debugger, which most developers will want.

Of the others, they primarily reduce the size of your executable. For example, if you have two identical strings literals char *a = "happy holidays", *b = "happy holidays", they will reside in the same piece of memory when string pooling is enabled.

OTHER TIPS

Turn on PDB

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top