I'm guessing that I'm missing something fundamental here, and hoping someone can point it out to me.
I want to have a function parameter whose type is user-defined. There are three functions in the following code, abc, pqr, and stu. All of them are accepted, except stu, which produces these error messages:
user_types_test:3: error: variable or field 'stu' declared void
user_types_test:3: error: 'T3L' was not declared in this scope
The code in question is:
typedef struct { int p ; // number of pin the lead for the Green internal LED is attached to
} T3L ;
T3L t1 ;
void pqr( T3L parm_name ) ; // function declaration
void abc( int parm_name ) { return ; } ; // function definition with built-in type
void stu( T3L parm_name ) { return ; } ; // function definition with user-defined type
void setup() {}
void loop() {}
And yes, the error message points to an empty line (line 3), so that is completely useless.
To make the message go away and prove to yourself that everything else is good, merely comment out the line for stu.
I'm not sure what to think. For one thing, I can't tell if the compiler is applying standard C rules, or those for C++.
Any ideas?