-
Notifications
You must be signed in to change notification settings - Fork 33
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 compiler warnings on VS2019 #9
base: master
Are you sure you want to change the base?
Fix compiler warnings on VS2019 #9
Conversation
@@ -977,13 +977,14 @@ class SQCompiler | |||
break; | |||
} | |||
|
|||
SQObject id; | |||
SQObject id = {}; |
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.
Satisfy the compiler
SQObject constant; | ||
|
||
switch(_token) { | ||
case TK_IDENTIFIER: id = _fs->CreateString(_lex._svalue); break; | ||
case TK_THIS: id = _fs->CreateString(_SC("this"),4); break; | ||
case TK_CONSTRUCTOR: id = _fs->CreateString(_SC("constructor"),11); break; | ||
default: Error("Unhandled token type %d", _token); break; |
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.
Safety
#pragma warning(disable: 4611) // interaction between '_setjmp' and C++ object destruction is non-portable | ||
#endif | ||
|
||
#if defined(_MSC_VER) |
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.
Enable platform/compiler specific handling for unreachable code.
The _MSC_VER condition could be changed to a user defined flag, allowing
users to choose the behaviour of UNREACHABLE.
Happy to accept feedback.
709c111
to
aa4d2cf
Compare
This PR fixes a bunch of compiler warnings generated by VS2019
Only tested these changes on VS2019.