'static' functions bug in 1.6.6 IDE

I have just update to 1.6.6 and now all my static function cause a problem. Example -

static void doSomething()
{

}

void setup() {
  doSomething();
}

void loop() {

}

That is perfectly valid C/C++ code but this very simple example fails with error message

exit status 1
'void doSomething()' was declared 'extern' and later 'static' [-fpermissive]

The example works perfectly without problems on earlier 1.x.x versions that I have used.

My intention in using 'static' is to make sure there is no name clash with external functions (this is what static is for in this context). It seems that the pre-processing performed by the IDE when creating the temporary source file creates forward references to extern'ed' functions making them global instead of just local so one cannot have local functions.

Now I can get round this by going through all my projects and removing the 'static' keyword from my local functions but I should not need to do this. Note - 'static' variables do not have this problem.

You may well have a valid point, as a work-around see:

How to avoid the quirks of the IDE sketch file pre-preprocessing

Most of the time getting round this is not difficult but should I have to ? I can ensure no name clash by making all my functions non-static and wrapping them in a namespace.

Note - the problem still exists when using a namespace to enclose the static functions!

The IDE tries to generate function prototypes for you. I'll see if I can reproduce it and raise a bug report.

See: Function prototype generator ignores "static" keyword · Issue #4123 · arduino/Arduino · GitHub

Thanks Nick.