When do I need to initialise variables?
• (REG) All variables should be initialised (implicitly or explicitly) before they are read from. Automatic variables are placed on the stack, and thus will have a random initial value. This means that you need to manually initialise them. Static variables are placed in the .bss section, which is initialised to zero by the kernel (at the start of the boot sequence). If the initial value of a static variable should be zero, you don’t need to do anything. If it should be a non-zero value, you will need to initialise it. Note that you should not explicitly initialise a static variable to zero, as this will increase the size of the kernel image, which causes problems for embedded systems.