forked from jasder/antlr
Fixed C++ tests and build warnings
This commit is contained in:
parent
faa64fdfa7
commit
93c06214a6
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue