-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Fix windows warnings (C4554, C4018) and mark error message constants as constexpr (C26814) #8360
base: master
Are you sure you want to change the base?
Fix windows warnings (C4554, C4018) and mark error message constants as constexpr (C26814) #8360
Conversation
…as constexpr (C26814)
You should add check that |
|
Yes, but iberrors.h is a public header. Firebird build requirements are not applied to public headers. |
Didn't notice right away that the public header was affected. In this case, this PR is incorrect. In this case, you will have to split the implementation C++ < 17 and C++ >= 17. |
Yes, I was sure these errors are used only in internal code and did not pay enough attention to the include location of the file. |
Actually I see no reason to mark integer constants |
I think if you have C++17 you should mark every constexpr variable in header file as inline constexpr, because it will use external linkage. For visual difference of external and internal linkage of variables in header file you can watch this video. |
External linkage is good for complex types such as strings because it leaves only one instance of data in executable image. But integers? They used to be embedded into assembler code directly even if declared with simple |
IIRC if someone will try to take an address or pass by reference this const variable it will be allocated in memory, so in this case, inline will do it job. |
src/isql/FrontendLexer.cpp
Outdated
@@ -142,7 +142,7 @@ std::variant<FrontendLexer::SingleStatement, FrontendLexer::IncompleteTokenError | |||
|
|||
while (pos < end) | |||
{ | |||
if (end - pos >= term.length() && std::equal(term.begin(), term.end(), pos)) | |||
if (static_cast<decltype(term.length())>(end - pos) >= term.length() && std::equal(term.begin(), term.end(), pos)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a fixed type, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to FB_SIZE_T
No description provided.