diff mbox series

Add caveat about parsing of .gcda and .gcno files.

Message ID 71d117ed-f654-4c16-9376-449874a6751c@suse.cz
State New
Headers show
Series Add caveat about parsing of .gcda and .gcno files. | expand

Commit Message

Martin Liška May 7, 2020, 7:32 a.m. UTC
Hi.

Let's discourage people from parsing of the coverage files.
We invented `gcov --json-format` for those who need a machine
readable format.

I'm going to install the patch if there are no objections.
Martin

gcc/ChangeLog:

2020-05-07  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/94928
	* gcov-io.h: Add caveat about coverage format parsing and
	possible outdated documentation.
---
  gcc/gcov-io.h | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index d21a43c4c31..2d99932a4b8 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -25,7 +25,13 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 
-/* Coverage information is held in two files.  A notes file, which is
+/* CAVEAT: Coverage information files should not be parsed directly, but
+   we would rather recommend using `gcov --json-format` that provides
+   a machine readable coverage information.
+
+   Note that the following file format documentation can be outdated.
+
+   Coverage information is held in two files.  A notes file, which is
    generated by the compiler, and a data file, which is generated by
    the program under test.  Both files use a similar structure.  We do
    not attempt to make these files backwards compatible with previous