Skip to content

Function prototypes not generated for variable argument functions [imported] #992

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

Closed
cmaglie opened this issue Nov 15, 2012 · 3 comments
Closed
Assignees
Labels
Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Milestone

Comments

@cmaglie
Copy link
Member

cmaglie commented Nov 15, 2012

This is Issue 992 moved from a Google Code project.
Added by 2012-07-27T17:08:51.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium, Component-IDE

Original description

What steps will reproduce the problem?

  1. Make new Arduino project having a main file and additional ".ino" file.
  2. Into additional ".ino" file insert a function definition having C style variable arguments.
    void nice_func(const char *fmt, ...)
    {
    // do nothing
    }
  3. Now insert call to that function into main file. For example inside
    loop function:
    void loop()
    {
    nice_func("test", 1);
    }

During compilation of the whole project Arduino gives error that
'nice_func' was not declared in this scope.

When we peek into temporary build directory then we can see that Arduino is not inserting that function prototype definition into final .cpp file.

For example if you change inside additional ".ino" file this function definition to:
void nice_func(const char *fmt, int i)
{
// do nothing
}
and now it'll compile without errors.

It seems that file building functionality (part that is inserting prototype definitions)
inside Arduino is skipping functions having "..." inside arguments area.

I'm using Arduino 1.0.1 on WinXP x64.

@ffissore
Copy link
Contributor

Please checkout this thread [1] on devs mailing list and try one of the linked IDEs. It should fix the problems reported in this issue
[1] https://groups.google.com/a/arduino.cc/forum/#!topic/developers/4X2T3rCxXWM

@ffissore
Copy link
Contributor

New preprocessor tracked at #2636. Builds for testing it are available

@ffissore ffissore modified the milestone: Release 1.6.5 Jun 5, 2015
@ffissore
Copy link
Contributor

Fixed by #3779

@ffissore ffissore added this to the Release 1.6.6 milestone Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Projects
None yet
Development

No branches or pull requests

3 participants