$-W corresponds to the warning level set forth by the -W flag.
The behavior of this variable is rather strange. If -W is not given, the value is 1:
But if you give any of -v, -w or -W (without the argument), the value is 2:
If you pass an argument to -W, that value is respected:
I am not entirely sure how this variable is supposed to influence the warning output, however.