Hello,
yes, there is an option to ignore all warnings: -W2.
But the compiler will not produce a warning for an unreferenced static local. A static local variable is handled like a global variable (with different access scope, of course), an if it is not used, the linker will dead strip/remove it.
But you can find the information that it has been removed in the linker map file here:
*********************************************************************************************
UNUSED-OBJECTS SECTION
---------------------------------------------------------------------------------------------
Otherwise you could use a tool like PC-lint to catch these kind of things.
Hope this helps,
BK