Skip to content

Generated function prototype injected before declaration of custom parameter type #1269

Closed as not planned
@allnick

Description

@allnick

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 submittedtopic: build-processRelated to the sketch build processtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions