diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-12-08 15:47:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-12-08 15:47:08 +0200 |
commit | dd078eec87eb89a9a21c22b1a18f982d04adb3c9 (patch) | |
tree | ba8a822b4e4be0de1b5dee31f22f4d6e034600dd | |
parent | 1702d75cb90c3a9f630cb884ccf158dd5a7eecf8 (diff) |
Improve inconsistent C++ compiler diagnostics
-rw-r--r-- | build2/cc/compile.cxx | 18 | ||||
-rw-r--r-- | build2/diagnostics.hxx | 8 |
2 files changed, 20 insertions, 6 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index a81f147..bb0ad37 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -2698,8 +2698,22 @@ namespace build2 // our progress. // if (force_gen_skip && *force_gen_skip == skip_count) - fail << "inconsistent " << x_lang << " compiler behavior" << - info << "perhaps you are running out of disk space"; + { + diag_record dr (fail); + + dr << "inconsistent " << x_lang << " compiler behavior"; + + // Show the yo-yo'ing command lines. + // + dr << info; + print_process (dr, args.data ()); // No pipes. + + init_args ((gen = true)); + dr << info << ""; + print_process (dr, args.data ()); // No pipes. + + dr << info << "perhaps you are running out of disk space?"; + } restart = true; force_gen = true; diff --git a/build2/diagnostics.hxx b/build2/diagnostics.hxx index dc96352..65b1834 100644 --- a/build2/diagnostics.hxx +++ b/build2/diagnostics.hxx @@ -36,15 +36,15 @@ namespace build2 print_process (const char* const* args, size_t n = 0); inline void - print_process (diag_record& dr, const cstrings& args) + print_process (diag_record& dr, const cstrings& args, size_t n = 0) { - print_process (dr, args.data (), args.size ()); + print_process (dr, args.data (), n != 0 ? n : args.size ()); } inline void - print_process (const cstrings& args) + print_process (const cstrings& args, size_t n = 0) { - print_process (args.data (), args.size ()); + print_process (args.data (), n != 0 ? n : args.size ()); } // Program verbosity level (-v/--verbose). |