On Thu Aug 17 15:23:11 2023 +0000, Gabriel Ivăncescu wrote:
What's the point of this? It's just a simple constant, we never use its address, so it makes no sense for it to be static.
The main advantage is that a static constant can be initialized from a sizeof, which tells the reader that there is little chance that the magic number was calculated incorrectly. A static constant is also more likely to be optimized out, although in the case of a single integer it doesn't matter much.