Original Post
- I''m not asking why you''d optimize code for space or speed requirements, and I''m not questioning that it really does what it says (as far as VC++ goes, anyway). -And I understand the debug version scatters features through it to help track errors, so I can easily understand why that would take some extra space even though I don''t know how that''s done. My question is, why can you optimize it different ways? If I have a simple DOS console that prints the text "Whatever" to the screen and I compile it normally and get a 220 kb EXE, and then I compile it for speed and get a 240 kb EXE, and then I compile it for space and get a 180 kb EXE, what is the smaller file missing? What extra does the larger file have? It would seem to me that you''d (-we''d all!-) be better off if there was only one correct way to compile any source file: one way that includes all the information given in the source file, and nothing extra. This would seem to be the fastest code, and the most compact. How can the compiler derive different EXE sizes from the same source file?