From 411d012399d5a364695e7738c42da6e233e859b2 Mon Sep 17 00:00:00 2001 From: "Prof. Ronald Moore" <ronald.moore@h-da.de> Date: Fri, 1 May 2020 14:10:16 +0200 Subject: [PATCH] Improved CFLAGS in the Compiler, and fixed the warnings this brought to light --- recursiveDescentParsers/cplusplus/interpreter/Makefile | 2 +- recursiveDescentParsers/cplusplus/interpreter/interpreter.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/recursiveDescentParsers/cplusplus/interpreter/Makefile b/recursiveDescentParsers/cplusplus/interpreter/Makefile index 9804468..1413587 100644 --- a/recursiveDescentParsers/cplusplus/interpreter/Makefile +++ b/recursiveDescentParsers/cplusplus/interpreter/Makefile @@ -12,7 +12,7 @@ TESTFILES := testInput.txt testOutput.txt CC := clang++ ## Add your own CFLAGS if you find them necessary... such as -O3 or so... -CFLAGS := +CFLAGS := -g -std=c++17 -Wall ## More preliminaries diff --git a/recursiveDescentParsers/cplusplus/interpreter/interpreter.cpp b/recursiveDescentParsers/cplusplus/interpreter/interpreter.cpp index c481e21..2963c1a 100644 --- a/recursiveDescentParsers/cplusplus/interpreter/interpreter.cpp +++ b/recursiveDescentParsers/cplusplus/interpreter/interpreter.cpp @@ -43,7 +43,6 @@ static std::istream *input = &(std::cin); // until proven otherwise static std::string currentLine( "" ); static int currentLineNumber = -1; static int currentColumnNumber = 0; -static int currentTokenLength = 0; static Token next_token; // again with the global variables... static numberType currentNumber; // = zero.... @@ -165,7 +164,7 @@ numberType E2ndHalf() { // T´ → * F T´ | / F T´ | ε numberType T2ndHalf() { - numberType tmp, rhs, acc; + numberType tmp; // Compiler forces me to put this here :-( switch ( next_token ) { case tok_times : next_token = gettok(); // eat * -- GitLab