Skip to content

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

@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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy