From dd078eec87eb89a9a21c22b1a18f982d04adb3c9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Dec 2017 15:47:08 +0200 Subject: Improve inconsistent C++ compiler diagnostics --- build2/cc/compile.cxx | 18 ++++++++++++++++-- build2/diagnostics.hxx | 8 ++++---- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'build2') 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). -- cgit v1.1