-
-
Notifications
You must be signed in to change notification settings - Fork 414
Closed as not planned
Closed as not planned
Copy link
Labels
conclusion: duplicateHas already been submittedHas already been submittedtopic: build-processRelated to the sketch build processRelated to the sketch build processtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
The type declared after any function is not visible as the parameter type for any other function below.
Although it is suitable for other purposes.
For example:
struct tword{
byte low;
byte high;
};
void none(){}
bool test(tword par){return true;}
void setup() {
word w;
tword* var = (tword*)(&w);
}
void loop(){}
It's ok.
void none(){}
struct tword{
byte low;
byte high;
};
//bool test(tword par){return true;}
void setup() {
word w;
tword* var = (tword*)(&w);
}
void loop(){}
Too it's ok
void none(){}
struct tword{
byte low;
byte high;
};
bool test(tword par){return true;}
void setup() {
word w;
tword* var = (tword*)(&w);
}
void loop(){}
Compilation fails with the error:
'tword' was not declared in this scope
Additional context
Additional reports
Metadata
Metadata
Assignees
Labels
conclusion: duplicateHas already been submittedHas already been submittedtopic: build-processRelated to the sketch build processRelated to the sketch build processtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project