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

New Clang warning: "'extern' variable has an initializer" #94

Closed
snej opened this issue Jul 25, 2016 · 3 comments
Closed

New Clang warning: "'extern' variable has an initializer" #94

snej opened this issue Jul 25, 2016 · 3 comments
Assignees

Comments

@snej
Copy link
Contributor

snej commented Jul 25, 2016

The latest change to Database.cpp triggers a compiler warning from Clang:

/Couchbase/SQForest/vendor/SQLiteCpp/src/Database.cpp:35:21: warning: 'extern' variable has an initializer [-Wextern-initializer]
extern const char*  VERSION        = SQLITE_VERSION;

The extern qualifiers on this and the other declarations here should be removed, since these are the actual definitions of the constants, not just references to them.

@SRombauts
Copy link
Owner

Hi, thanks for reporting!

@SRombauts SRombauts self-assigned this Jul 26, 2016
@SRombauts
Copy link
Owner

Thanks to you, I released the v2.0.0 without a warning.
Cheers!

@pmor13
Copy link

pmor13 commented Aug 31, 2022

@snej FYI: extern is not qualifier, but storage-class specifier (in both C and C++). Also: this warning exists in GCC and it is "a coding style warning - the code is valid".

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