Open khushi-411 opened 5 months ago
As per title.
Command to replicate:
mkdir build && cd build && cmake .. && make VERBOSE=1 && cd ..
```cpp In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:19, from /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:9: /home/khushi/Documents/lox.cpp/src/Scanner.h: In member function ‘void lox::Scanner::identifier()’: /home/khushi/Documents/lox.cpp/src/Scanner.h:191:15: warning: NULL used in arithmetic [-Wpointer-arith] 191 | if (type == NULL) { | ^~~~ In file included from /home/khushi/Documents/lox.cpp/src/Interpreter.h:10, from /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:8: /home/khushi/Documents/lox.cpp/src/Interpreter.h: In instantiation of ‘class lox::Interpreter’: /home/khushi/Documents/lox.cpp/src/Lox.h:30:30: required from ‘class lox::Lox’ /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Stmt.h:187:13: warning: ‘T lox::stmt::Visitor::visitWhileStmt(const lox::stmt::While&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 187 | virtual T visitWhileStmt(const While& stmt) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:36:8: note: by ‘void lox::Interpreter::visitWhileStmt(const lox::stmt::While&) [with T = double]’ 36 | void visitWhileStmt(const lox::stmt::While& _stmt); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:186:13: warning: ‘T lox::stmt::Visitor::visitVarStmt(const lox::stmt::Var&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 186 | virtual T visitVarStmt(const Var& stmt) const = 0; | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:35:8: note: by ‘void lox::Interpreter::visitVarStmt(const lox::stmt::Var&) [with T = double]’ 35 | void visitVarStmt(const lox::stmt::Var& _stmt); | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:185:13: warning: ‘T lox::stmt::Visitor::visitReturnStmt(const lox::stmt::Return&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 185 | virtual T visitReturnStmt(const Return& stmt) const = 0; | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:34:8: note: by ‘void lox::Interpreter::visitReturnStmt(const lox::stmt::Return&) [with T = double]’ 34 | void visitReturnStmt(const lox::stmt::Return& _stmt); | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:184:13: warning: ‘T lox::stmt::Visitor::visitPrintStmt(const lox::stmt::Print&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 184 | virtual T visitPrintStmt(const Print& stmt) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:33:8: note: by ‘void lox::Interpreter::visitPrintStmt(const lox::stmt::Print&) [with T = double]’ 33 | void visitPrintStmt(const lox::stmt::Print& _stmt); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:183:13: warning: ‘T lox::stmt::Visitor::visitIfStmt(const lox::stmt::If&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 183 | virtual T visitIfStmt(const If& stmt) const = 0; | ^~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:32:8: note: by ‘void lox::Interpreter::visitIfStmt(const lox::stmt::If&) [with T = double]’ 32 | void visitIfStmt(const lox::stmt::If& _stmt); | ^~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:182:13: warning: ‘T lox::stmt::Visitor::visitFunctionStmt(const lox::stmt::Function&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 182 | virtual T visitFunctionStmt(const Function& stmt) const = 0; | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:31:8: note: by ‘void lox::Interpreter::visitFunctionStmt(const lox::stmt::Function&) [with T = double]’ 31 | void visitFunctionStmt(const lox::stmt::Function& _stmt); | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:181:13: warning: ‘T lox::stmt::Visitor::visitExpressionStmt(const lox::stmt::Expression&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 181 | virtual T visitExpressionStmt(const Expression& stmt) const = 0; | ^~~~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:30:8: note: by ‘void lox::Interpreter::visitExpressionStmt(const lox::stmt::Expression&) [with T = double]’ 30 | void visitExpressionStmt(const lox::stmt::Expression& _stmt); | ^~~~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:180:13: warning: ‘T lox::stmt::Visitor::visitClassStmt(const lox::stmt::Class&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 180 | virtual T visitClassStmt(const Class& stmt) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:29:8: note: by ‘void lox::Interpreter::visitClassStmt(const lox::stmt::Class&) [with T = double]’ 29 | void visitClassStmt(const lox::stmt::Class& _stmt); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:179:13: warning: ‘T lox::stmt::Visitor::visitBlockStmt(const lox::stmt::Block&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 179 | virtual T visitBlockStmt(const Block& stmt) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:28:8: note: by ‘void lox::Interpreter::visitBlockStmt(const lox::stmt::Block&) [with T = double]’ 28 | void visitBlockStmt(const lox::stmt::Block& _stmt); | ^~~~~~~~~~~~~~ In file included from /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:7: /home/khushi/Documents/lox.cpp/src/Expr.h:239:13: warning: ‘T lox::expr::Visitor::visitVariableExpr(const lox::expr::Variable&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 239 | virtual T visitVariableExpr(const Variable& expr) const = 0; | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:58:10: note: by ‘Object lox::Interpreter::visitVariableExpr(const lox::expr::Variable&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 58 | Object visitVariableExpr(const lox::expr::Variable& _expr); | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:238:13: warning: ‘T lox::expr::Visitor::visitUnaryExpr(const lox::expr::Unary&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 238 | virtual T visitUnaryExpr(const Unary& expr) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:57:10: note: by ‘Object lox::Interpreter::visitUnaryExpr(const lox::expr::Unary&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 57 | Object visitUnaryExpr(const lox::expr::Unary& _expr); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:237:13: warning: ‘T lox::expr::Visitor::visitThisExpr(const lox::expr::This&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 237 | virtual T visitThisExpr(const This& expr) const = 0; | ^~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:56:10: note: by ‘Object lox::Interpreter::visitThisExpr(const lox::expr::This&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 56 | Object visitThisExpr(const lox::expr::This& _expr); | ^~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:236:13: warning: ‘T lox::expr::Visitor::visitSuperExpr(const lox::expr::Super&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 236 | virtual T visitSuperExpr(const Super& expr) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:55:10: note: by ‘Object lox::Interpreter::visitSuperExpr(const lox::expr::Super&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 55 | Object visitSuperExpr(const lox::expr::Super& _expr); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:235:13: warning: ‘T lox::expr::Visitor::visitSetExpr(const lox::expr::Set&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 235 | virtual T visitSetExpr(const Set& expr) const = 0; | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:54:10: note: by ‘Object lox::Interpreter::visitSetExpr(const lox::expr::Set&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 54 | Object visitSetExpr(const lox::expr::Set& _expr); | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:234:13: warning: ‘T lox::expr::Visitor::visitLogicalExpr(const lox::expr::Logical&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 234 | virtual T visitLogicalExpr(const Logical& expr) const = 0; | ^~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:53:10: note: by ‘Object lox::Interpreter::visitLogicalExpr(const lox::expr::Logical&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 53 | Object visitLogicalExpr(const lox::expr::Logical& _expr); | ^~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:233:13: warning: ‘T lox::expr::Visitor::visitLiteralExpr(const lox::expr::Literal&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 233 | virtual T visitLiteralExpr(const Literal& expr) const = 0; | ^~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:52:10: note: by ‘Object lox::Interpreter::visitLiteralExpr(const lox::expr::Literal&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 52 | Object visitLiteralExpr(const lox::expr::Literal& _expr); | ^~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:232:13: warning: ‘T lox::expr::Visitor::visitGroupingExpr(const lox::expr::Grouping&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 232 | virtual T visitGroupingExpr(const Grouping& expr) const = 0; | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:51:10: note: by ‘Object lox::Interpreter::visitGroupingExpr(const lox::expr::Grouping&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 51 | Object visitGroupingExpr(const lox::expr::Grouping& _expr); | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:231:13: warning: ‘T lox::expr::Visitor::visitGetExpr(const lox::expr::Get&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 231 | virtual T visitGetExpr(const Get& expr) const = 0; | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:50:10: note: by ‘Object lox::Interpreter::visitGetExpr(const lox::expr::Get&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 50 | Object visitGetExpr(const lox::expr::Get& _expr); | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:230:13: warning: ‘T lox::expr::Visitor::visitCallExpr(const lox::expr::Call&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 230 | virtual T visitCallExpr(const Call& expr) const = 0; | ^~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:49:10: note: by ‘Object lox::Interpreter::visitCallExpr(const lox::expr::Call&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 49 | Object visitCallExpr(const lox::expr::Call& _expr); | ^~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:229:13: warning: ‘T lox::expr::Visitor::visitBinaryExpr(const lox::expr::Binary&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 229 | virtual T visitBinaryExpr(const Binary& expr) const = 0; | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:48:10: note: by ‘Object lox::Interpreter::visitBinaryExpr(const lox::expr::Binary&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 48 | Object visitBinaryExpr(const lox::expr::Binary& _expr); | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Expr.h:228:13: warning: ‘T lox::expr::Visitor::visitAssignExpr(const lox::expr::Assign&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=] 228 | virtual T visitAssignExpr(const Assign& expr) const = 0; | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:47:10: note: by ‘Object lox::Interpreter::visitAssignExpr(const lox::expr::Assign&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’ 47 | Object visitAssignExpr(const lox::expr::Assign& _expr); | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.cpp: In member function ‘Object lox::Interpreter::lookUpVariable(const lox::Token&, const lox::expr::Expr&)’: /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:503:19: warning: NULL used in arithmetic [-Wpointer-arith] 503 | if (distance != NULL) { | ^~~~ /home/khushi/Documents/lox.cpp/src/Lox.h: In instantiation of ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’: /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Lox.h:83:24: warning: variable ‘expression’ set but not used [-Wunused-but-set-variable] 83 | lox::expr::Expr expression = parser.parse(); | ^~~~~~~~~~ In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:16: /home/khushi/Documents/lox.cpp/src/Parser.h: In instantiation of ‘lox::expr::Expr lox::parser::Parser::parse() [with T = double]’: /home/khushi/Documents/lox.cpp/src/Lox.h:83:49: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’ /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Parser.h:364:23: warning: catching polymorphic type ‘class lox::parser::ParseError’ by value [-Wcatch-value=] 364 | } catch (ParseError error) { | ^~~~~ /home/khushi/Documents/lox.cpp/src/Scanner.h: In instantiation of ‘bool lox::Scanner::isAtEnd() [with T = double]’: /home/khushi/Documents/lox.cpp/src/Scanner.h:87:20: required from ‘std::vector lox::Scanner::scanTokens() [with T = double]’ /home/khushi/Documents/lox.cpp/src/Lox.h:76:51: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’ /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Scanner.h:299:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 299 | return current >= source.length(); | ~~~~~~~~^~~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Scanner.h: In instantiation of ‘void lox::Scanner::identifier() [with T = double]’: /home/khushi/Documents/lox.cpp/src/Scanner.h:171:21: required from ‘void lox::Scanner::scanToken() [with T = double]’ /home/khushi/Documents/lox.cpp/src/Scanner.h:89:17: required from ‘std::vector lox::Scanner::scanTokens() [with T = double]’ /home/khushi/Documents/lox.cpp/src/Lox.h:76:51: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’ /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Scanner.h:191:12: warning: NULL used in arithmetic [-Wpointer-arith] 191 | if (type == NULL) { | ^ /home/khushi/Documents/lox.cpp/src/Scanner.h: In instantiation of ‘char lox::Scanner::peekNext() [with T = double]’: /home/khushi/Documents/lox.cpp/src/Scanner.h:207:39: required from ‘void lox::Scanner::number() [with T = double]’ /home/khushi/Documents/lox.cpp/src/Scanner.h:169:21: required from ‘void lox::Scanner::scanToken() [with T = double]’ /home/khushi/Documents/lox.cpp/src/Scanner.h:89:17: required from ‘std::vector lox::Scanner::scanTokens() [with T = double]’ /home/khushi/Documents/lox.cpp/src/Lox.h:76:51: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’ /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Scanner.h:272:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 272 | if (current + 1 >= source.length()) { | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /home/khushi/Documents/lox.cpp/src/Parser.h:4: /home/khushi/Documents/lox.cpp/src/Parser.h: In member function ‘bool lox::parser::Parser::match(const lox::TokenType&, ...) [with T = double]’: /home/khushi/Documents/lox.cpp/src/Parser.h:457:28: warning: ‘lox::TokenType’ is promoted to ‘int’ when passed through ‘...’ 457 | type = va_arg(args, TokenType)) { | ^ /home/khushi/Documents/lox.cpp/src/Parser.h:457:28: note: (so you should pass ‘int’ not ‘lox::TokenType’ to ‘va_arg’) /home/khushi/Documents/lox.cpp/src/Parser.h:457:28: note: if this code is reached, the program will abort [ 33%] Building CXX object CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o /usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o -MF CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o -c /home/khushi/Documents/lox.cpp/src/LoxClass.cpp [ 38%] Building CXX object CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o /usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o -MF CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o -c /home/khushi/Documents/lox.cpp/src/LoxFunction.cpp [ 44%] Building CXX object CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o /usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o -MF CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o -c /home/khushi/Documents/lox.cpp/src/LoxInstance.cpp [ 50%] Building CXX object CMakeFiles/lox.cpp.dir/src/Parser.cpp.o /usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/Parser.cpp.o -MF CMakeFiles/lox.cpp.dir/src/Parser.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/Parser.cpp.o -c /home/khushi/Documents/lox.cpp/src/Parser.cpp In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:19, from /home/khushi/Documents/lox.cpp/src/Parser.cpp:4: /home/khushi/Documents/lox.cpp/src/Scanner.h: In member function ‘void lox::Scanner::identifier()’: /home/khushi/Documents/lox.cpp/src/Scanner.h:191:15: warning: NULL used in arithmetic [-Wpointer-arith] 191 | if (type == NULL) { | ^~~~ In file included from /home/khushi/Documents/lox.cpp/src/ASTPrinter.h:8, from /home/khushi/Documents/lox.cpp/src/Lox.h:13: /home/khushi/Documents/lox.cpp/src/Interpreter.h: In instantiation of ‘class lox::Interpreter’: /home/khushi/Documents/lox.cpp/src/Lox.h:30:30: required from ‘class lox::Lox’ /home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here /home/khushi/Documents/lox.cpp/src/Stmt.h:187:13: warning: ‘T lox::stmt::Visitor::visitWhileStmt(const lox::stmt::While&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 187 | virtual T visitWhileStmt(const While& stmt) const = 0; | ^~~~~~~~~~~~~~ In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:15: /home/khushi/Documents/lox.cpp/src/Interpreter.h:36:8: note: by ‘void lox::Interpreter::visitWhileStmt(const lox::stmt::While&) [with T = double]’ 36 | void visitWhileStmt(const lox::stmt::While& _stmt); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:186:13: warning: ‘T lox::stmt::Visitor::visitVarStmt(const lox::stmt::Var&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 186 | virtual T visitVarStmt(const Var& stmt) const = 0; | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:35:8: note: by ‘void lox::Interpreter::visitVarStmt(const lox::stmt::Var&) [with T = double]’ 35 | void visitVarStmt(const lox::stmt::Var& _stmt); | ^~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:185:13: warning: ‘T lox::stmt::Visitor::visitReturnStmt(const lox::stmt::Return&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 185 | virtual T visitReturnStmt(const Return& stmt) const = 0; | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:34:8: note: by ‘void lox::Interpreter::visitReturnStmt(const lox::stmt::Return&) [with T = double]’ 34 | void visitReturnStmt(const lox::stmt::Return& _stmt); | ^~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:184:13: warning: ‘T lox::stmt::Visitor::visitPrintStmt(const lox::stmt::Print&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 184 | virtual T visitPrintStmt(const Print& stmt) const = 0; | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:33:8: note: by ‘void lox::Interpreter::visitPrintStmt(const lox::stmt::Print&) [with T = double]’ 33 | void visitPrintStmt(const lox::stmt::Print& _stmt); | ^~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:183:13: warning: ‘T lox::stmt::Visitor::visitIfStmt(const lox::stmt::If&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 183 | virtual T visitIfStmt(const If& stmt) const = 0; | ^~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:32:8: note: by ‘void lox::Interpreter::visitIfStmt(const lox::stmt::If&) [with T = double]’ 32 | void visitIfStmt(const lox::stmt::If& _stmt); | ^~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:182:13: warning: ‘T lox::stmt::Visitor::visitFunctionStmt(const lox::stmt::Function&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 182 | virtual T visitFunctionStmt(const Function& stmt) const = 0; | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:31:8: note: by ‘void lox::Interpreter::visitFunctionStmt(const lox::stmt::Function&) [with T = double]’ 31 | void visitFunctionStmt(const lox::stmt::Function& _stmt); | ^~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Stmt.h:181:13: warning: ‘T lox::stmt::Visitor::visitExpressionStmt(const lox::stmt::Expression&) const [with T = void]’ was hidden [-Woverloaded-virtual=] 181 | virtual T visitExpressionStmt(const Expression& stmt) const = 0; | ^~~~~~~~~~~~~~~~~~~ /home/khushi/Documents/lox.cpp/src/Interpreter.h:30:8: note: by ‘void lox::Interpreter::visitExpressionStmt(const lox::stmt::Expression&) [with T = double]’ 30 | void visitExpressionStmt(const lox::stmt::Expression
As per title.
Command to replicate:
Build warnings
```cpp In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:19, from /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:9: /home/khushi/Documents/lox.cpp/src/Scanner.h: In member function ‘void lox::Scanner::identifier()’:
/home/khushi/Documents/lox.cpp/src/Scanner.h:191:15: warning: NULL used in arithmetic [-Wpointer-arith]
191 | if (type == NULL) {
| ^~~~
In file included from /home/khushi/Documents/lox.cpp/src/Interpreter.h:10,
from /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:8:
/home/khushi/Documents/lox.cpp/src/Interpreter.h: In instantiation of ‘class lox::Interpreter’:
/home/khushi/Documents/lox.cpp/src/Lox.h:30:30: required from ‘class lox::Lox’
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Stmt.h:187:13: warning: ‘T lox::stmt::Visitor::visitWhileStmt(const lox::stmt::While&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
187 | virtual T visitWhileStmt(const While& stmt) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:36:8: note: by ‘void lox::Interpreter::visitWhileStmt(const lox::stmt::While&) [with T = double]’
36 | void visitWhileStmt(const lox::stmt::While& _stmt);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:186:13: warning: ‘T lox::stmt::Visitor::visitVarStmt(const lox::stmt::Var&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
186 | virtual T visitVarStmt(const Var& stmt) const = 0;
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:35:8: note: by ‘void lox::Interpreter::visitVarStmt(const lox::stmt::Var&) [with T = double]’
35 | void visitVarStmt(const lox::stmt::Var& _stmt);
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:185:13: warning: ‘T lox::stmt::Visitor::visitReturnStmt(const lox::stmt::Return&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
185 | virtual T visitReturnStmt(const Return& stmt) const = 0;
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:34:8: note: by ‘void lox::Interpreter::visitReturnStmt(const lox::stmt::Return&) [with T = double]’
34 | void visitReturnStmt(const lox::stmt::Return& _stmt);
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:184:13: warning: ‘T lox::stmt::Visitor::visitPrintStmt(const lox::stmt::Print&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
184 | virtual T visitPrintStmt(const Print& stmt) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:33:8: note: by ‘void lox::Interpreter::visitPrintStmt(const lox::stmt::Print&) [with T = double]’
33 | void visitPrintStmt(const lox::stmt::Print& _stmt);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:183:13: warning: ‘T lox::stmt::Visitor::visitIfStmt(const lox::stmt::If&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
183 | virtual T visitIfStmt(const If& stmt) const = 0;
| ^~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:32:8: note: by ‘void lox::Interpreter::visitIfStmt(const lox::stmt::If&) [with T = double]’
32 | void visitIfStmt(const lox::stmt::If& _stmt);
| ^~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:182:13: warning: ‘T lox::stmt::Visitor::visitFunctionStmt(const lox::stmt::Function&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
182 | virtual T visitFunctionStmt(const Function& stmt) const = 0;
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:31:8: note: by ‘void lox::Interpreter::visitFunctionStmt(const lox::stmt::Function&) [with T = double]’
31 | void visitFunctionStmt(const lox::stmt::Function& _stmt);
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:181:13: warning: ‘T lox::stmt::Visitor::visitExpressionStmt(const lox::stmt::Expression&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
181 | virtual T visitExpressionStmt(const Expression& stmt) const = 0;
| ^~~~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:30:8: note: by ‘void lox::Interpreter::visitExpressionStmt(const lox::stmt::Expression&) [with T = double]’
30 | void visitExpressionStmt(const lox::stmt::Expression& _stmt);
| ^~~~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:180:13: warning: ‘T lox::stmt::Visitor::visitClassStmt(const lox::stmt::Class&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
180 | virtual T visitClassStmt(const Class& stmt) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:29:8: note: by ‘void lox::Interpreter::visitClassStmt(const lox::stmt::Class&) [with T = double]’
29 | void visitClassStmt(const lox::stmt::Class& _stmt);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:179:13: warning: ‘T lox::stmt::Visitor::visitBlockStmt(const lox::stmt::Block&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
179 | virtual T visitBlockStmt(const Block& stmt) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:28:8: note: by ‘void lox::Interpreter::visitBlockStmt(const lox::stmt::Block&) [with T = double]’
28 | void visitBlockStmt(const lox::stmt::Block& _stmt);
| ^~~~~~~~~~~~~~
In file included from /home/khushi/Documents/lox.cpp/src/Interpreter.cpp:7:
/home/khushi/Documents/lox.cpp/src/Expr.h:239:13: warning: ‘T lox::expr::Visitor::visitVariableExpr(const lox::expr::Variable&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
239 | virtual T visitVariableExpr(const Variable& expr) const = 0;
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:58:10: note: by ‘Object lox::Interpreter::visitVariableExpr(const lox::expr::Variable&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
58 | Object visitVariableExpr(const lox::expr::Variable& _expr);
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:238:13: warning: ‘T lox::expr::Visitor::visitUnaryExpr(const lox::expr::Unary&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
238 | virtual T visitUnaryExpr(const Unary& expr) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:57:10: note: by ‘Object lox::Interpreter::visitUnaryExpr(const lox::expr::Unary&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
57 | Object visitUnaryExpr(const lox::expr::Unary& _expr);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:237:13: warning: ‘T lox::expr::Visitor::visitThisExpr(const lox::expr::This&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
237 | virtual T visitThisExpr(const This& expr) const = 0;
| ^~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:56:10: note: by ‘Object lox::Interpreter::visitThisExpr(const lox::expr::This&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
56 | Object visitThisExpr(const lox::expr::This& _expr);
| ^~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:236:13: warning: ‘T lox::expr::Visitor::visitSuperExpr(const lox::expr::Super&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
236 | virtual T visitSuperExpr(const Super& expr) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:55:10: note: by ‘Object lox::Interpreter::visitSuperExpr(const lox::expr::Super&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
55 | Object visitSuperExpr(const lox::expr::Super& _expr);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:235:13: warning: ‘T lox::expr::Visitor::visitSetExpr(const lox::expr::Set&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
235 | virtual T visitSetExpr(const Set& expr) const = 0;
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:54:10: note: by ‘Object lox::Interpreter::visitSetExpr(const lox::expr::Set&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
54 | Object visitSetExpr(const lox::expr::Set& _expr);
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:234:13: warning: ‘T lox::expr::Visitor::visitLogicalExpr(const lox::expr::Logical&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
234 | virtual T visitLogicalExpr(const Logical& expr) const = 0;
| ^~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:53:10: note: by ‘Object lox::Interpreter::visitLogicalExpr(const lox::expr::Logical&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
53 | Object visitLogicalExpr(const lox::expr::Logical& _expr);
| ^~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:233:13: warning: ‘T lox::expr::Visitor::visitLiteralExpr(const lox::expr::Literal&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
233 | virtual T visitLiteralExpr(const Literal& expr) const = 0;
| ^~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:52:10: note: by ‘Object lox::Interpreter::visitLiteralExpr(const lox::expr::Literal&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
52 | Object visitLiteralExpr(const lox::expr::Literal& _expr);
| ^~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:232:13: warning: ‘T lox::expr::Visitor::visitGroupingExpr(const lox::expr::Grouping&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
232 | virtual T visitGroupingExpr(const Grouping& expr) const = 0;
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:51:10: note: by ‘Object lox::Interpreter::visitGroupingExpr(const lox::expr::Grouping&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
51 | Object visitGroupingExpr(const lox::expr::Grouping& _expr);
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:231:13: warning: ‘T lox::expr::Visitor::visitGetExpr(const lox::expr::Get&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
231 | virtual T visitGetExpr(const Get& expr) const = 0;
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:50:10: note: by ‘Object lox::Interpreter::visitGetExpr(const lox::expr::Get&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
50 | Object visitGetExpr(const lox::expr::Get& _expr);
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:230:13: warning: ‘T lox::expr::Visitor::visitCallExpr(const lox::expr::Call&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
230 | virtual T visitCallExpr(const Call& expr) const = 0;
| ^~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:49:10: note: by ‘Object lox::Interpreter::visitCallExpr(const lox::expr::Call&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
49 | Object visitCallExpr(const lox::expr::Call& _expr);
| ^~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:229:13: warning: ‘T lox::expr::Visitor::visitBinaryExpr(const lox::expr::Binary&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
229 | virtual T visitBinaryExpr(const Binary& expr) const = 0;
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:48:10: note: by ‘Object lox::Interpreter::visitBinaryExpr(const lox::expr::Binary&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
48 | Object visitBinaryExpr(const lox::expr::Binary& _expr);
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Expr.h:228:13: warning: ‘T lox::expr::Visitor::visitAssignExpr(const lox::expr::Assign&) const [with T = std::variant, std::allocator >, double, bool>]’ was hidden [-Woverloaded-virtual=]
228 | virtual T visitAssignExpr(const Assign& expr) const = 0;
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:47:10: note: by ‘Object lox::Interpreter::visitAssignExpr(const lox::expr::Assign&) [with T = double; Object = std::variant, std::allocator >, double, bool>]’
47 | Object visitAssignExpr(const lox::expr::Assign& _expr);
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.cpp: In member function ‘Object lox::Interpreter::lookUpVariable(const lox::Token&, const lox::expr::Expr&)’:
/home/khushi/Documents/lox.cpp/src/Interpreter.cpp:503:19: warning: NULL used in arithmetic [-Wpointer-arith]
503 | if (distance != NULL) {
| ^~~~
/home/khushi/Documents/lox.cpp/src/Lox.h: In instantiation of ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’:
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Lox.h:83:24: warning: variable ‘expression’ set but not used [-Wunused-but-set-variable]
83 | lox::expr::Expr expression = parser.parse();
| ^~~~~~~~~~
In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:16:
/home/khushi/Documents/lox.cpp/src/Parser.h: In instantiation of ‘lox::expr::Expr lox::parser::Parser::parse() [with T = double]’:
/home/khushi/Documents/lox.cpp/src/Lox.h:83:49: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Parser.h:364:23: warning: catching polymorphic type ‘class lox::parser::ParseError’ by value [-Wcatch-value=]
364 | } catch (ParseError error) {
| ^~~~~
/home/khushi/Documents/lox.cpp/src/Scanner.h: In instantiation of ‘bool lox::Scanner::isAtEnd() [with T = double]’:
/home/khushi/Documents/lox.cpp/src/Scanner.h:87:20: required from ‘std::vector lox::Scanner::scanTokens() [with T = double]’
/home/khushi/Documents/lox.cpp/src/Lox.h:76:51: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Scanner.h:299:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
299 | return current >= source.length();
| ~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Scanner.h: In instantiation of ‘void lox::Scanner::identifier() [with T = double]’:
/home/khushi/Documents/lox.cpp/src/Scanner.h:171:21: required from ‘void lox::Scanner::scanToken() [with T = double]’
/home/khushi/Documents/lox.cpp/src/Scanner.h:89:17: required from ‘std::vector lox::Scanner::scanTokens() [with T = double]’
/home/khushi/Documents/lox.cpp/src/Lox.h:76:51: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Scanner.h:191:12: warning: NULL used in arithmetic [-Wpointer-arith]
191 | if (type == NULL) {
| ^
/home/khushi/Documents/lox.cpp/src/Scanner.h: In instantiation of ‘char lox::Scanner::peekNext() [with T = double]’:
/home/khushi/Documents/lox.cpp/src/Scanner.h:207:39: required from ‘void lox::Scanner::number() [with T = double]’
/home/khushi/Documents/lox.cpp/src/Scanner.h:169:21: required from ‘void lox::Scanner::scanToken() [with T = double]’
/home/khushi/Documents/lox.cpp/src/Scanner.h:89:17: required from ‘std::vector lox::Scanner::scanTokens() [with T = double]’
/home/khushi/Documents/lox.cpp/src/Lox.h:76:51: required from ‘void lox::Lox::run(const std::string&) [with T = double; std::string = std::__cxx11::basic_string]’
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Scanner.h:272:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
272 | if (current + 1 >= source.length()) {
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /home/khushi/Documents/lox.cpp/src/Parser.h:4:
/home/khushi/Documents/lox.cpp/src/Parser.h: In member function ‘bool lox::parser::Parser::match(const lox::TokenType&, ...) [with T = double]’:
/home/khushi/Documents/lox.cpp/src/Parser.h:457:28: warning: ‘lox::TokenType’ is promoted to ‘int’ when passed through ‘...’
457 | type = va_arg(args, TokenType)) {
| ^
/home/khushi/Documents/lox.cpp/src/Parser.h:457:28: note: (so you should pass ‘int’ not ‘lox::TokenType’ to ‘va_arg’)
/home/khushi/Documents/lox.cpp/src/Parser.h:457:28: note: if this code is reached, the program will abort
[ 33%] Building CXX object CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o
/usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o -MF CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/LoxClass.cpp.o -c /home/khushi/Documents/lox.cpp/src/LoxClass.cpp
[ 38%] Building CXX object CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o
/usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o -MF CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/LoxFunction.cpp.o -c /home/khushi/Documents/lox.cpp/src/LoxFunction.cpp
[ 44%] Building CXX object CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o
/usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o -MF CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/LoxInstance.cpp.o -c /home/khushi/Documents/lox.cpp/src/LoxInstance.cpp
[ 50%] Building CXX object CMakeFiles/lox.cpp.dir/src/Parser.cpp.o
/usr/bin/c++ -Dlox_cpp_EXPORTS -I/home/khushi/Documents/lox.cpp/src -std=c++20 -fPIC -Wall -Wno-unused-function -MD -MT CMakeFiles/lox.cpp.dir/src/Parser.cpp.o -MF CMakeFiles/lox.cpp.dir/src/Parser.cpp.o.d -o CMakeFiles/lox.cpp.dir/src/Parser.cpp.o -c /home/khushi/Documents/lox.cpp/src/Parser.cpp
In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:19,
from /home/khushi/Documents/lox.cpp/src/Parser.cpp:4:
/home/khushi/Documents/lox.cpp/src/Scanner.h: In member function ‘void lox::Scanner::identifier()’:
/home/khushi/Documents/lox.cpp/src/Scanner.h:191:15: warning: NULL used in arithmetic [-Wpointer-arith]
191 | if (type == NULL) {
| ^~~~
In file included from /home/khushi/Documents/lox.cpp/src/ASTPrinter.h:8,
from /home/khushi/Documents/lox.cpp/src/Lox.h:13:
/home/khushi/Documents/lox.cpp/src/Interpreter.h: In instantiation of ‘class lox::Interpreter’:
/home/khushi/Documents/lox.cpp/src/Lox.h:30:30: required from ‘class lox::Lox’
/home/khushi/Documents/lox.cpp/src/Lox.h:134:21: required from here
/home/khushi/Documents/lox.cpp/src/Stmt.h:187:13: warning: ‘T lox::stmt::Visitor::visitWhileStmt(const lox::stmt::While&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
187 | virtual T visitWhileStmt(const While& stmt) const = 0;
| ^~~~~~~~~~~~~~
In file included from /home/khushi/Documents/lox.cpp/src/Lox.h:15:
/home/khushi/Documents/lox.cpp/src/Interpreter.h:36:8: note: by ‘void lox::Interpreter::visitWhileStmt(const lox::stmt::While&) [with T = double]’
36 | void visitWhileStmt(const lox::stmt::While& _stmt);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:186:13: warning: ‘T lox::stmt::Visitor::visitVarStmt(const lox::stmt::Var&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
186 | virtual T visitVarStmt(const Var& stmt) const = 0;
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:35:8: note: by ‘void lox::Interpreter::visitVarStmt(const lox::stmt::Var&) [with T = double]’
35 | void visitVarStmt(const lox::stmt::Var& _stmt);
| ^~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:185:13: warning: ‘T lox::stmt::Visitor::visitReturnStmt(const lox::stmt::Return&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
185 | virtual T visitReturnStmt(const Return& stmt) const = 0;
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:34:8: note: by ‘void lox::Interpreter::visitReturnStmt(const lox::stmt::Return&) [with T = double]’
34 | void visitReturnStmt(const lox::stmt::Return& _stmt);
| ^~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:184:13: warning: ‘T lox::stmt::Visitor::visitPrintStmt(const lox::stmt::Print&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
184 | virtual T visitPrintStmt(const Print& stmt) const = 0;
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:33:8: note: by ‘void lox::Interpreter::visitPrintStmt(const lox::stmt::Print&) [with T = double]’
33 | void visitPrintStmt(const lox::stmt::Print& _stmt);
| ^~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:183:13: warning: ‘T lox::stmt::Visitor::visitIfStmt(const lox::stmt::If&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
183 | virtual T visitIfStmt(const If& stmt) const = 0;
| ^~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:32:8: note: by ‘void lox::Interpreter::visitIfStmt(const lox::stmt::If&) [with T = double]’
32 | void visitIfStmt(const lox::stmt::If& _stmt);
| ^~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:182:13: warning: ‘T lox::stmt::Visitor::visitFunctionStmt(const lox::stmt::Function&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
182 | virtual T visitFunctionStmt(const Function& stmt) const = 0;
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:31:8: note: by ‘void lox::Interpreter::visitFunctionStmt(const lox::stmt::Function&) [with T = double]’
31 | void visitFunctionStmt(const lox::stmt::Function& _stmt);
| ^~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Stmt.h:181:13: warning: ‘T lox::stmt::Visitor::visitExpressionStmt(const lox::stmt::Expression&) const [with T = void]’ was hidden [-Woverloaded-virtual=]
181 | virtual T visitExpressionStmt(const Expression& stmt) const = 0;
| ^~~~~~~~~~~~~~~~~~~
/home/khushi/Documents/lox.cpp/src/Interpreter.h:30:8: note: by ‘void lox::Interpreter::visitExpressionStmt(const lox::stmt::Expression&) [with T = double]’
30 | void visitExpressionStmt(const lox::stmt::Expression