From 3b66b429c69183b7dd8d6845b8dd24718e4bbd0d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 6 Aug 2017 13:26:32 +0200 Subject: Make sure warnings are disables for GCC -M run --- build2/cc/compile.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index dad53ff..f3aef29 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -1852,24 +1852,31 @@ namespace build2 { // Overwrite. // - args[i] = "-M"; - args[i + 1] = "-MG"; - args[i + 2] = src.path ().string ().c_str (); - args[i + 3] = nullptr; + args[i++] = "-M"; + args[i++] = "-MG"; if (cid == compiler_id::gcc) { sense_diag = false; + + // While GCC implies -w in case of -M, it seems to be possible + // to re-enable it with -W or -Werror. So we explicitly disable + // it, for good measure. + // + args[i++] = "-w"; } + + args[i++] = src.path ().string ().c_str (); + args[i] = nullptr; } else { // Restore. // - args[i] = "-MD"; - args[i + 1] = "-E"; - args[i + 2] = pp; - args[i + 3] = "-MF"; + args[i++] = "-MD"; + args[i++] = "-E"; + args[i++] = pp; + args[i] = "-MF"; if (cid == compiler_id::gcc) { -- cgit v1.1