This is a very common question...
We tend to misread the warning... when it clearly states "the variable is not used"...
And it means just that, that we have declared a variable but it remains unassigned any value. This is helpful, because sometimes we declare variables to be used as flags somewhere in the code, but later we end up not using them due to code changes...
Declaring a variable allocates memory to it, so having empty variables is a waste of precious resources.