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

Avoid compiler warnings about initializing externs #25

Closed
eyalroz opened this issue May 13, 2022 · 2 comments
Closed

Avoid compiler warnings about initializing externs #25

eyalroz opened this issue May 13, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eyalroz
Copy link
Contributor

eyalroz commented May 13, 2022

When building with GCC 10.2.1, I get:

/path/to/dylib/tests/lib.cpp:4:18: warning: ‘pi_value’ initialized and declared ‘extern’
    4 | DYLIB_API double pi_value = 3.14159;
      |                  ^~~~~~~~
/path/to/src/dylib/tests/lib.cpp:5:17: warning: ‘ptr’ initialized and declared ‘extern’
    5 | DYLIB_API void *ptr = (void *)1;
      |                 ^~~

The point is that either you declare something extern (coming from elsewhere), or you initialize it, but not both on the same line.

@martin-olivier martin-olivier self-assigned this May 13, 2022
@martin-olivier martin-olivier added the bug Something isn't working label May 13, 2022
@martin-olivier martin-olivier linked a pull request May 13, 2022 that will close this issue
7 tasks
@martin-olivier
Copy link
Owner

Hi, I just made your requested changes on #26

@martin-olivier
Copy link
Owner

Also referenced in #35.
I will close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants