public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-67] gcov: Fix first time gcov info dump
@ 2022-05-02  8:52 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2022-05-02  8:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:880a9845dc126e10ceb07b846d5a4c5b167b5185

commit r13-67-g880a9845dc126e10ceb07b846d5a4c5b167b5185
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Mon May 2 08:44:16 2022 +0200

    gcov: Fix first time gcov info dump
    
    This patch fixes an issue introduced by commit
    ef9a53feae5701953da9161afef2aea0329ec8b2:
    
    gcc --coverage main.c && ./a.out
    libgcov profiling error:a-main.gcda:Error writing
    
    gcc/ChangeLog:
    
            * gcov-io.cc (gcov_rewrite):  Clear the file error status.

Diff:
---
 gcc/gcov-io.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/gcov-io.cc b/gcc/gcov-io.cc
index fdf745e6ce1..62032ccfa18 100644
--- a/gcc/gcov-io.cc
+++ b/gcc/gcov-io.cc
@@ -79,11 +79,14 @@ gcov_is_error (void)
 }
 
 #if IN_LIBGCOV
-/* Move to beginning of file and initialize for writing.  */
+/* Move to beginning of file, initialize for writing, and clear file error
+   status.  */
+
 GCOV_LINKAGE inline void
 gcov_rewrite (void)
 {
   gcov_var.mode = -1; 
+  gcov_var.error = GCOV_FILE_NO_ERROR;
   fseek (gcov_var.file, 0L, SEEK_SET);
 }
 #endif


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-02  8:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02  8:52 [gcc r13-67] gcov: Fix first time gcov info dump Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).