|
When you start you program, the C compiler adds the code to process the Command Line Parameters and the Environment Strings. If you know that you won't be using these features in your program, you can cut a little bit off the size of your program.
If you create your own empty _setargv and _setenvp routines, then the C compiler will be content with these and not include the internal alternatives.
void _setargv() {};
void _setenvp() {};
void main(void) {
_setargv();
_setenvp();
printf("A demo program to ignore the processing of the\n");
printf("commandline chars and the processing of the environment\n");
}
The previous program above is around 500 bytes smaller when you do this technique. However, the linker will give you a redifination error if you have the extended dictionary attribute on.
¥
|