i have a situation here. this is related to my other thread about
mcuApiC lib. this time about the hex compiled size resulted from the compiler (or linker?). now i want to start a new project using that library. i do nothing except declaring the class that i've built... ok here's the stat...
1) no library involved...
int main() {
return 0;
};
Program:
288 bytes
Data: 0 bytes...
2) include the library, declare the mac_display class...
#include "mac_lib_spec.h"
mac_display disp;
int main() {
return 0;
};
BOOM!
Program:
2884 bytes
Data: 6 bytes...
3) enable the font class in the mac_lib_spec.h (not shown in app code, i.e. same code as above), i dont even declare any font variable...
BOOM! BOOM! BOOM!
Program:
5536 bytes
Data: 6 bytes...
FWIW. this is my project setting (all defaulted except i removed the -gnu88, gave me warning)
-Wall
-gdwarf-2
-Os
-funsigned-char
-funsigned-bitfields
-fpack-struct
-fshort-enums
i can understand the "Data" but i dont understand the compiled 'Program' size. its like 'ALL' the class members and library functions are happily joining together merrymaking in the hex file. Whats going on? i thought the linker will be clever enough to omit any functions that is not called?
ps: i removed all declaration to classes, ie same as code #1, but library enabled (display and font classes)... still at 5000+ bytes mark, shoot!!! (pls note the triple exclamation