From 01f3447e5bddceabb8997c71c653080903212913 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Thu, 24 Nov 2016 13:40:22 +0000 Subject: [PATCH] Fix #171 --- parser.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/parser.cpp b/parser.cpp index 004d374..995e26e 100644 --- a/parser.cpp +++ b/parser.cpp @@ -6324,11 +6324,15 @@ bool parser_finish(parser_t *parser, const char *output) } parser_remove_ast(parser); - if (compile_Werrors) { - con_out("*** there were warnings treated as errors\n"); - compile_show_werrors(); - retval = false; - } + auto fnCheckWErrors = [&retval]() { + if (compile_Werrors) { + con_out("*** there were warnings treated as errors\n"); + compile_show_werrors(); + retval = false; + } + }; + + fnCheckWErrors(); if (retval) { if (OPTS_OPTION_BOOL(OPTION_DUMPFIN)) @@ -6339,6 +6343,9 @@ bool parser_finish(parser_t *parser, const char *output) delete ir; return false; } + + // ir->generate can generate compiler warnings + fnCheckWErrors(); } delete ir; return retval;