From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC33C3858423; Wed, 5 Jul 2023 19:41:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC33C3858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688586106; bh=nhHE7Y4JOKVM8XEStHyNgIITTxHi8lt3g9rRx66Zs7g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x9q4QXu8F76pluPzpbMJ2rkdsLx7p33eec5RjjupucBHaBN5EfqbdPE3xKBE5dtTd 622+W7ubTZam1TmFXi3dCwCxyNfu1Fz+8JG4B2QXXXnSSdRbzcCh6b2FA4+1yl4Xt5 Io/Aoh/nltWwEEmvllTl9wgEDJbMim9domrrDf9g= From: "carlosgalvezp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/110561] gcov counts closing bracket in a function as executable, lowering coverage statistics Date: Wed, 05 Jul 2023 19:41:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110561 --- Comment #4 from Carlos Galvez --- To clarify, the .gcov file looks like this (correct) on GCC 7.5.0, which I believe is newer than the duplicated bug mentioned here: -: 0:Source:main.cpp -: 0:Graph:main.gcno -: 0:Data:main.gcda -: 0:Runs:1 -: 0:Programs:1 -: 1:#include -: 2:#include -: 3: 1: 4:std::string joinPath(std::vector const& path_parts) -: 5:{ 1: 6: std::string path{}; 3: 7: for (auto const& path_part : path_parts) -: 8: { 2: 9: if (!path.empty()) -: 10: { 1: 11: path +=3D "/"; -: 12: } -: 13: 2: 14: path +=3D path_part; -: 15: } -: 16: 1: 17: return path; -: 18:} -: 19: 1: 20:int main() -: 21:{ 2: 22: std::vector strings =3D {"foo", "bar"}; 1: 23: joinPath(strings); 1: 24:}=