The compiler gives you warnings to hint at things that could potentially be a problem or unintentional.
Unused variables will most likely be optimized. But perhaps you intended to do something with them, in which case the compiler gratefully notes that you may have done something you did not want.
What use in a variable do you declare, but do not read or write?
Joey
source share