From: Dale Weiler Date: Thu, 24 Nov 2016 13:40:22 +0000 (+0000) Subject: Fix #171 X-Git-Tag: xonotic-v0.8.5~54 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=01f3447e5bddceabb8997c71c653080903212913;p=xonotic%2Fgmqcc.git Fix #171 --- 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;