Adding -Wextra -Werror to compiler flags and fixing issues.

This commit is contained in:
Stefano Sanfilippo 2015-03-07 17:24:25 +01:00
parent 226aff325f
commit e921a24929
3 changed files with 7 additions and 3 deletions

View File

@ -129,6 +129,8 @@ llvm::Type *LLVMType(Type const& type) {
case Type::UNKNOWN: case Type::UNKNOWN:
return nullptr; // FIXME return nullptr; // FIXME
} }
return nullptr;
} }
static static
@ -355,7 +357,7 @@ bool BitcodeEmitter::emit(Input const& node) {
return true; return true;
} }
bool BitcodeEmitter::emit(Abort const& node) { bool BitcodeEmitter::emit(Abort const&) {
llvm::Function *callee = module->getFunction(ABORT_NAME); llvm::Function *callee = module->getFunction(ABORT_NAME);
if (callee == nullptr) { if (callee == nullptr) {

View File

@ -85,7 +85,9 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
) )
add_definitions(-Wall -Wno-deprecated-register -std=c++0x -DYYDEBUG=0 -O2) add_definitions(
-Wall -Wextra -Werror -Wno-deprecated-register -std=c++0x -DYYDEBUG=0 -O2
)
bison_target(Parser Monicelli.ypp ${CMAKE_CURRENT_BINARY_DIR}/Parser.cpp) bison_target(Parser Monicelli.ypp ${CMAKE_CURRENT_BINARY_DIR}/Parser.cpp)
flex_target(Scanner Monicelli.lpp ${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp) flex_target(Scanner Monicelli.lpp ${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp)

View File

@ -26,7 +26,7 @@
using namespace monicelli; using namespace monicelli;
int main(int argc, char **argv) { int main() {
Program program; Program program;
Scanner scanner(&std::cin); Scanner scanner(&std::cin);
Parser parser(scanner, program); Parser parser(scanner, program);