I never said this code does not compile. > Without code that can be compiled, without compiler version and compiler > options it's just guessing around. > > As we have no code that compiles (noone has PanelPellet, CNapisy, ST_OFF > ...) look at the genrated code and what takes the additional RAM.
lets get rolling then using avr-gcc-4.5.3 build opts are: avr-gcc -c -mmcu=atmega128 -x c++ -gdwarf-2 -DF_CPU=3686400UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -fno-exceptions -Wall -Wundef -ffunction-sections -fdata-sections -Wa,-adhlns=OBJ/PanelPellet.lst -I. -IhrdDefs -ImyClasses -MMD -MP -MF .dep/PanelPellet.o.d PanelPellet.cpp -o OBJ/PanelPellet.o >> I thought this should not take any RAM until execution, am I right? > > > Obviously, not. You tried -fno-tree-switch-conversion? Obviously there's no reson it should. -fno-tree-switch-conversion does not making any difference. I prepared some related code snippets that should give You general idea how its organized. http://pastebin.com/96dWVww8 Yet, this example code compiling just fine and avr-size report 0 bytes RAM used, just as it should. And there is something i discovered just min ago, when I modify static CNapisy::TTextId getStateString(uint8_t state) to static uint16_t getStateString(uint8_t state) and change all returns to return some decimal values, it does not increase ram usage. Marcin 2011/12/17 Georg-Johann Lay <a...@gjlay.de>: > Marcin S wrote: >> >> Hello, >> I'm trying to figure out what's wrong with this code, I have this >> >> [bunch of code that does not compile] >> >> >> When I use this method in my program then according to avr-size, RAM >> memory usage jumps by 168 bytes! Why? > > > There may be all sorts of explanation for that. > > Without code that can be compiled, without compiler version and compiler > options it's just guessing around. > > As we have no code that compiles (noone has PanelPellet, CNapisy, ST_OFF > ...) look at the genrated code and what takes the additional RAM. > > >> I thought this should not take any RAM until execution, am I right? > > > Obviously, not. You tried -fno-tree-switch-conversion? > _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list