Skip to content

Fix compiler warnings on VS2019 - #9

Open
jamesmintram wants to merge 8 commits into
GaijinEntertainment:masterfrom
jamesmintram:jamesmintram/compiler-warns
Open

Fix compiler warnings on VS2019#9
jamesmintram wants to merge 8 commits into
GaijinEntertainment:masterfrom
jamesmintram:jamesmintram/compiler-warns

Conversation

@jamesmintram

@jamesmintram jamesmintram commented May 9, 2021

Copy link
Copy Markdown

This PR fixes a bunch of compiler warnings generated by VS2019

Only tested these changes on VS2019.

Comment thread squirrel/sqcompiler.cpp
}

SQObject id;
SQObject id = {};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Satisfy the compiler

Comment thread squirrel/sqcompiler.cpp
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
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safety

Comment thread squirrel/sqpcheader.h
#pragma warning(disable: 4611) // interaction between '_setjmp' and C++ object destruction is non-portable
#endif

#if defined(_MSC_VER)

Copy link
Copy Markdown
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