Re:Modern C
by tomjakubowski on Friday September 04, 2020 @02:09PM
(#24377425)
In standard C only constant values can initialize globals, so the value can be baked into the binary.
[ Parent
| on HN ]
Re:Modern C
by brandmeyer on Friday September 04, 2020 @06:30PM
(#24379536)
"baked into the binary" covers a lot of ground. You've got to get the initial contents of .data initialized somehow. In a typical microcontroller that's a copy from flash to ram.