Two fine points to consider The compiler discards any unused code and data This includes all static functions you don't call And also data structures you don't refer to. In the blatant case, a warning is reported "function F defined but not used" "unused variable V" Constants known at build time help in this decision This is why "if (0)" is good trick No warning about "unused code/data" is reported But still the function/data is discarded Additionally, the linker eventually discards unused sections This only if "--gc-sections" is requested Thus, you need to protect precious data Use "__attribute__((used))" in source files Use KEEP(section) in the liker script