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

Eliminate extern-initializer warning #192

Merged
merged 1 commit into from
Aug 7, 2021
Merged

Eliminate extern-initializer warning #192

merged 1 commit into from
Aug 7, 2021

Conversation

danielytics
Copy link
Contributor

When including crow.h (or, rather, routing.h) without CROW_MAIN, the INVALID_BP_ID variable is declared as extern, which is triggers the -Wextern-initializer warning (at least with clang):

include/crow/routing.h:25:21: error: 'extern' variable has an initializer [-Werror,-Wextern-initializer]                                                                                                                           
    extern uint16_t INVALID_BP_ID{0xFFFF};   

Since Crow is header-only, this means that any sources using Crow cannot be compiled with -Werror or similar. This PR simply removes the initialzer when declaring as extern.

@The-EDev
Copy link
Member

The-EDev commented Aug 7, 2021

Thanks for noticing this and fixing it, it was an error on my part. Merging now

@The-EDev The-EDev merged commit 077bf0f into CrowCpp:master Aug 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants