Click here to Skip to main content
15,923,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How i can prevent right click in windows explorer Pin
Jörgen Sigvardsson27-Sep-06 13:48
Jörgen Sigvardsson27-Sep-06 13:48 
Questionbloat reduction Pin
Waldermort27-Sep-06 2:17
Waldermort27-Sep-06 2:17 
AnswerRe: bloat reduction Pin
Rajesh R Subramanian27-Sep-06 2:30
professionalRajesh R Subramanian27-Sep-06 2:30 
GeneralRe: bloat reduction Pin
Waldermort27-Sep-06 2:42
Waldermort27-Sep-06 2:42 
GeneralRe: bloat reduction Pin
Zac Howland27-Sep-06 3:56
Zac Howland27-Sep-06 3:56 
AnswerRe: bloat reduction Pin
Maximilien27-Sep-06 2:41
Maximilien27-Sep-06 2:41 
GeneralRe: bloat reduction Pin
Waldermort27-Sep-06 2:44
Waldermort27-Sep-06 2:44 
AnswerRe: bloat reduction Pin
Mike Dimmick27-Sep-06 4:04
Mike Dimmick27-Sep-06 4:04 
The linker includes everything in a section (called a COMDAT) where any member of that section is referenced, if the /OPT:REF switch is specified (which is the default if /DEBUG is not specified). By default the compiler simply generates one COMDAT per source file, but by specifying the /Gy switch, it will instead generate one COMDAT per function. The combination of /Gy and /OPT:REF can be used to eliminate some dead code.

A library is simply a collection of .obj files; the behaviour will depend on whether /Gy was used to build the .obj files in the library. Import libraries are always reduced to the minimum set referenced.

Note that there are techniques which will prevent /OPT:REF from being able to eliminate otherwise unreferenced functions. If you reference a function in a table of function pointers, for example, and the table itself is referenced, all the functions will be included even if those entries in the table are unused. This can apply to MFC message maps and C++ virtual function tables.

Link.exe can tell you what it did include. Generate a map file (with /MAP). This tells you the address at which every function was generated.

It can be confusing for a new developer to find bits of dead code - I've wasted plenty of time trying to work out how to fix code that wasn't actually being called. Since adopting source control, I now delete code that I discover to be dead and which couldn't fulfil any useful purpose if a class was reused. Sometimes you find routines implemented 'for completeness' that actually aren't used in the project which the class was created for. These should be a red flag because it usually means they weren't tested as thoroughly as the rest of the class.

Stability. What an interesting concept. -- Chris Maunder

GeneralRe: bloat reduction Pin
Waldermort27-Sep-06 4:50
Waldermort27-Sep-06 4:50 
QuestionClose an instance Pin
ayol1212227-Sep-06 1:34
ayol1212227-Sep-06 1:34 
AnswerRe: Close an instance Pin
Stephen Hewitt27-Sep-06 1:56
Stephen Hewitt27-Sep-06 1:56 
AnswerRe: Close an instance Pin
prasad_som27-Sep-06 1:58
prasad_som27-Sep-06 1:58 
GeneralRe: Close an instance Pin
ayol1212227-Sep-06 3:31
ayol1212227-Sep-06 3:31 
Questionerror LNK2001 Pin
Rems Kris27-Sep-06 1:24
Rems Kris27-Sep-06 1:24 
AnswerRe: error LNK2001 Pin
Rinu_Raj27-Sep-06 1:39
Rinu_Raj27-Sep-06 1:39 
GeneralRe: error LNK2001 Pin
Rems Kris27-Sep-06 1:48
Rems Kris27-Sep-06 1:48 
GeneralRe: error LNK2001 Pin
Rinu_Raj27-Sep-06 2:04
Rinu_Raj27-Sep-06 2:04 
GeneralRe: error LNK2001 Pin
Rems Kris27-Sep-06 17:43
Rems Kris27-Sep-06 17:43 
QuestionExtract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 0:13
Sakthiu27-Sep-06 0:13 
AnswerRe: Extract all text strings from a HTML file. How ? Pin
Hamid_RT27-Sep-06 0:21
Hamid_RT27-Sep-06 0:21 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 0:54
Sakthiu27-Sep-06 0:54 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Waldermort27-Sep-06 1:01
Waldermort27-Sep-06 1:01 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 1:04
Sakthiu27-Sep-06 1:04 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Rajesh R Subramanian27-Sep-06 1:08
professionalRajesh R Subramanian27-Sep-06 1:08 
GeneralRe: Extract all text strings from a HTML file. How ? Pin
Sakthiu27-Sep-06 1:23
Sakthiu27-Sep-06 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.