I'm working on a program composed by several classes.
I reduced the size of a single class of (more or less) one hundred lines (4kb of stuff)
I expected a smaller sketch but surprisingly it is increased in size (few bytes).
How is it possible?It's something about the compiler?
-
if it wasn't using those 100 lines anyway, you won't save anything... – dandavis Mar 23 '17 at 18:07
A compiler translates c/cpp to target assembly language.
To keep it short, some c/cpp language statements or keywords can be used to shorten the code (in c/cpp)... but the mechanics behind all that to translate to assembly can generate more instructions than you thought.
It would maybe be easier to explain if you put some example...
-
-
yep, true, thanks for pointing that out, i'll correct that (yet, you can code c libraries if you need)... and the generated assembly is even worse! – SMFSW Mar 23 '17 at 17:28