aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-06 13:26:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-06 13:26:32 +0200
commit3b66b429c69183b7dd8d6845b8dd24718e4bbd0d (patch)
treee43d8d18937ba2bbd8835efac1548919f5fdc9b3
parentee923008b83f3d5b02084e16b6291cc99e40058c (diff)
Make sure warnings are disables for GCC -M run
-rw-r--r--build2/cc/compile.cxx23
1 files 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)
{