From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id BB0123858D33 for ; Mon, 2 May 2022 08:43:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB0123858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nlReN-000FJl-Oq; Mon, 02 May 2022 10:43:23 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlReN-000URO-Lu; Mon, 02 May 2022 10:43:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id C802E4800CA; Mon, 2 May 2022 10:43:22 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id tG7JVM3xyQsZ; Mon, 2 May 2022 10:43:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3235E48016D; Mon, 2 May 2022 10:43:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pjTdCYkdW1zy; Mon, 2 May 2022 10:43:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 15E084800CA; Mon, 2 May 2022 10:43:22 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Subject: [PATCH] gcov: Fix first time gcov info dump Date: Mon, 2 May 2022 10:43:19 +0200 Message-Id: <20220502084319.69190-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.5/26528/Sun May 1 10:35:42 2022) X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2022 08:43:27 -0000 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. --- 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) } =20 #if IN_LIBGCOV -/* Move to beginning of file and initialize for writing. */ +/* Move to beginning of file, initialize for writing, and clear file err= or + status. */ + GCOV_LINKAGE inline void gcov_rewrite (void) { gcov_var.mode =3D -1;=20 + gcov_var.error =3D GCOV_FILE_NO_ERROR; fseek (gcov_var.file, 0L, SEEK_SET); } #endif --=20 2.34.1