Skip to content

Commit 12198c4

Browse files
committed
Add extra compiler flags
1 parent 4feb953 commit 12198c4

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
CXXFLAGS := -std=c++20 # use the 2020 version of the C++ standard
44
CXXFLAGS += -g # generate debugging information
5-
CXXFLAGS += -Wall # enable most warnings, except those about ...
6-
CXXFLAGS += -Wno-unused-parameter # ... unused function parameters, ...
7-
CXXFLAGS += -Wno-unused-variable # ... unused variables, ...
8-
CXXFLAGS += -Wno-unused-function # ... or unused functions.
5+
CXXFLAGS += -Wall # enable most warnings
6+
CXXFLAGS += -Wextra # enable extra warnings
7+
CXXFLAGS += -Werror # treat all warnings as errors
98
CXXFLAGS += -fsanitize=address # enable address sanitization
109
CXXFLAGS += -static-libasan # statically link with Address Sanitizer
1110
CXXFLAGS += -O0 # perform minimal optimisations

src/ast_constant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace ast {
44

5-
void IntConstant::EmitRISC(std::ostream& stream, Context& context) const
5+
void IntConstant::EmitRISC(std::ostream& stream, Context&) const
66
{
77
stream << "li a0, " << value_ << std::endl;
88
}

src/ast_identifier.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace ast {
44

5-
void Identifier::EmitRISC(std::ostream& stream, Context& context) const
5+
void Identifier::EmitRISC(std::ostream& stream, Context&) const
66
{
77
stream << identifier_;
88
}

src/lexer.flex

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
extern "C" int fileno(FILE *stream);
88

99
#include "parser.tab.hpp"
10+
11+
// Suppress warning about unused function
12+
[[maybe_unused]] static void yyunput (int c, char * yy_bp );
1013
%}
1114

1215
D [0-9]

0 commit comments

Comments
 (0)