Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function with default parameter doesn't get it's prototype in *.h header file. #4048

Closed
obiwan-bartek opened this issue Oct 30, 2015 · 2 comments
Assignees
Milestone

Comments

@obiwan-bartek
Copy link

When you write a function with at least one parameter with default value
eg.

void foo(int a, int b = 0)
{
}

it does not gets generated it's prototype in header file, which results in an unreferenced calls in project to that function. When you remove the default parameter

 = 0

the prototype shows in header file as expected.

@NicoHood
Copy link
Contributor

You need to do:

// prototype
void foo(int a, int b = 0);

// Implementation, better place inside a .cpp or marke the prototype above as static inline
void foo(int a, int b)
{

}

@ffissore
Copy link
Contributor

This issue was moved to arduino/arduino-builder#39

@ffissore ffissore added this to the Release 1.6.6 milestone Nov 2, 2015
@ffissore ffissore self-assigned this Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants