Fixed C++ tests and build warnings

This commit is contained in:
Mike Lischke 2021-03-09 11:01:57 +01:00
parent faa64fdfa7
commit 93c06214a6
2 changed files with 9 additions and 3 deletions

View File

@ -394,7 +394,8 @@ public class BaseCppTest extends BaseRuntimeTestSupport implements RuntimeTestSu
+ "\n"
+ "\n"
+ "int main(int argc, const char* argv[]) {\n"
+ " ANTLRFileStream input(argv[1]);\n"
+ " ANTLRFileStream input;\n"
+ " input.loadFile(argv[1]);\n"
+ " <lexerName> lexer(&input);\n"
+ " CommonTokenStream tokens(&lexer);\n"
+ "<createParser>"
@ -436,7 +437,8 @@ public class BaseCppTest extends BaseRuntimeTestSupport implements RuntimeTestSu
+ "using namespace antlr4;\n"
+ "\n"
+ "int main(int argc, const char* argv[]) {\n"
+ " ANTLRFileStream input(argv[1]);\n"
+ " ANTLRFileStream input;\n"
+ " input.loadFile(argv[1]);\n"
+ " <lexerName> lexer(&input);\n"
+ " CommonTokenStream tokens(&lexer);\n"
+ " tokens.fill();\n"

View File

@ -1348,7 +1348,9 @@ Parser* ParserATNSimulator::getParser() {
return parser;
}
#pragma warning (disable:4996) // 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead.
#ifdef _MSC_VER
#pragma warning (disable:4996) // 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead.
#endif
bool ParserATNSimulator::getLrLoopSetting() {
char *var = std::getenv("TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT");
@ -1358,7 +1360,9 @@ bool ParserATNSimulator::getLrLoopSetting() {
return value == "true" || value == "1";
}
#ifdef _MSC_VER
#pragma warning (default:4996)
#endif
void ParserATNSimulator::InitializeInstanceFields() {
_mode = PredictionMode::LL;