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

Fix compiler warnings on VS2019 #9

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jamesmintram
Copy link

@jamesmintram jamesmintram commented May 9, 2021

This PR fixes a bunch of compiler warnings generated by VS2019

Only tested these changes on VS2019.

@@ -977,13 +977,14 @@ class SQCompiler
break;
}

SQObject id;
SQObject id = {};
Copy link
Author

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;
Copy link
Author

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)
Copy link
Author

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.

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.

1 participant