X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=parser.cpp;h=995e26e521a14d59f3d83482c0285bc609b19d2e;hp=004d374024ec615787b072479cde0f77a5e606ae;hb=01f3447e5bddceabb8997c71c653080903212913;hpb=6938567c6cc44cd8e526278f75de3e3b1863133f 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;