I'll answer this myself. Digging around the documentation on the build process, we find:
"Next, the environment searches for function definitions within your main sketch file and creates declarations (prototypes) for them. These are inserted after any comments or pre-processor statements (#includes or #defines), but before any other statements (including type declarations). This means that if you want to use a custom type as a function argument, you should declare it within a separate header file."
As someone familiar with C++, but new to the Arduino platform, I was unaware the IDE was doing this. (Being familiar with C and C++, I was creating prototypes for functions manually when they were required.) It would be nice to be able to tell the IDE not to do this.
For reference, this results in the following input being fed to the compiler:
#line 1 "Silly002.ino"
#include "Arduino.h"
void myfunc(funcptr f); // THIS IS WHAT CAUSES THE ERROR TO OCCUR -- AUTOMATICALLY INSERTED BY IDE
void setup();
void loop();
#line 1
typedef void (*funcptr)();
void myfunc(funcptr f) {
}
void setup() {
}
void loop() {
}
That is closer to what I regard as development environment. You can click on a compiler error and open the source file with the cursor on the error line.
The Arduino as an AVR hardware base, though rather long in the tooth now, has merit, but the IDE is best suited to novice level, LED blinking type projects IMO.
It is a useful feature because it removes one common gotcha that the naive user
really shouldn't have to care/know about (declaring every function before use).
Once you are doing more complex stuff it can bite you, but the whole ethos of the
Arduino is make things simple and easy as possible for non programmers. You have
the source code to the software if you want to make your own modifications, such as
a preference to enable/disable this feature (check there isn't one already!)
"It is a useful feature because it removes one common gotcha that the novice driver
really shouldn't have to care/know about ( knowing how to drive a car.) "
aka dumbing down the user.
Making things "simpler" by making things more complicated has never worked for me.
The lunacy of Arduino is: if someone is still at the legoland level of programming what the hell are they doing working in C / C++ ???
For high performance , bare-metal, programming it is a good choice. For blinking LEDs it's probably among the worst.