I ran across this when using an example sketch from the "RCswitch" library. The example uses declarations of static functions and compiles perfectly in 1.65, but fails in 1.66, with an error message of the form: "void doSomething()' was declared 'extern' and later 'static' [-fpermissive]"
where void doSomething has been declared as 'static'. The reference in the error message to 'extern' turns out to be a complete red herring.
Fortunately I still have 1.65 installed on my Laptop and was able to continue working using that.
A bit of googling turned up the following: http://forum.arduino.cc/index.php?topic=358602.0
from 10 November 2015 which links to: https://github.com/arduino/Arduino/issues/4123
also from 10 Nov 2015.
The upshot is that the bug has already bee addressed in hourly builds and will be fixed in 1.67.
Hope this saves someone a bit of aggravation
Neil