Error Message "void ADCsync()' was declared 'extern' and later 'static' [-fpermi

Could someone please take a look at the sketch I have attached?

When I try to compile I get the error in the subject.

It is written for the Zero or M0 Pro, and is a method for getting super fast A/D. I have been trying to figure out what the problem is for over a day now, but I am very new to arduino, and I just can't figure it out.

Kind regards
Bob.

adcdma.ino (3.79 KB)

Compiles without errors in 1.6.5 and latest 1.6.7 hourly build (Dec 4).

Fails in 1.6.6.
The IDE generates this prototype

void ADCsync();

which does not quite match the original

static __inline__ void ADCsync() __attribute__((always_inline, unused));
static void   ADCsync() {
  while (ADC->STATUS.bit.SYNCBUSY == 1); //Just wait till the ADC is free
}

I along with several others reported this bug in 1.6.6 a couple of weeks ago. The fix for 1.6.6 is to remove the word static from all function declarations but unless you need features of 1.6.6 I would revert to 1.6.5. You could always live dangerously and go for the daily pre-release build of 1.6.7 .