diff options
author | Martin Liska <mliska@suse.cz> | 2023-05-04 10:27:55 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2023-05-04 10:27:55 +0200 |
commit | d879d68eb309561d266ddf734ab8c69f4fef3874 (patch) | |
tree | 2a10091cfb1410b9ea3792fce06a6e9bdf34c95c /gcc/gcov.cc | |
parent | ee99aaae4aeecd55f1d945a959652cf07e3b2e9e (diff) | |
download | gcc-d879d68eb309561d266ddf734ab8c69f4fef3874.zip gcc-d879d68eb309561d266ddf734ab8c69f4fef3874.tar.gz gcc-d879d68eb309561d266ddf734ab8c69f4fef3874.tar.bz2 |
gcov: add GCOV format version to gcov -v
gcc/ChangeLog:
* gcov.cc (GCOV_JSON_FORMAT_VERSION): New definition.
(print_version): Use it.
(generate_results): Likewise.
Diffstat (limited to 'gcc/gcov.cc')
-rw-r--r-- | gcc/gcov.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gcov.cc b/gcc/gcov.cc index d96b4f7..2fad6aa 100644 --- a/gcc/gcov.cc +++ b/gcc/gcov.cc @@ -58,6 +58,8 @@ using namespace std; #include "gcov-io.h" #include "gcov-io.cc" +#define GCOV_JSON_FORMAT_VERSION "2" + /* The gcno file is generated by -ftest-coverage option. The gcda file is generated by a program compiled with -fprofile-arcs. Their formats are documented in gcov-io.h. */ @@ -964,6 +966,7 @@ static void print_version (void) { fnotice (stdout, "gcov %s%s\n", pkgversion_string, version_string); + fnotice (stdout, "JSON format version: %s\n", GCOV_JSON_FORMAT_VERSION); fprintf (stdout, "Copyright %s 2023 Free Software Foundation, Inc.\n", _("(C)")); fnotice (stdout, @@ -1546,7 +1549,7 @@ generate_results (const char *file_name) gcov_intermediate_filename = get_gcov_intermediate_filename (file_name); json::object *root = new json::object (); - root->set ("format_version", new json::string ("2")); + root->set ("format_version", new json::string (GCOV_JSON_FORMAT_VERSION)); root->set ("gcc_version", new json::string (version_string)); if (bbg_cwd != NULL) |