views:

352

answers:

2

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!

+1  A: 

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.

Shane MacLaughlin
+1  A: 

Turn on PDB

Tim
Yep, never know when you're going to need it, espeicially if the current release has changed, and an earlier client version throws a fault.
Shane MacLaughlin