As said by others, there is no such thing as "un-initialising" a variable. That comment is misleading.
What the author probably meant is: let's set it to a value that clearly stands out (for example in the debugger) and that is not meant to be used by a program that runs correctly; instead, it is meant to be overwritten when the proper initialisation takes place. If the program crashes and the debugger shows the value is 0xFFFF
, it means the variable hasn't been initialised properly (otherwise it would have a different value), and then you know your code is accessing it at the wrong time, before the "correct" initialisation. Or, similarly, it could be that this function is called when the variable is not meant to be used again, and seeing that value indicates that the variable has been used after its intended "end of life".
This technique is applied by Visual Studio when debugging C++ code: the variables are all automatically initialised with special values, chosen to be easy to see and remember. Examples include 0xABABABAB
, 0xABADCAFE
and 0xDEADDEAD
. You can find more here and here. Wikipedia has a much longer list.
The author of this program is probably trying to replicate it. A better comment would be: "Set a_var
to a known wrong value that helps detecting improper early/late accesses to it".