From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58A733858C5E; Fri, 3 Nov 2023 19:40:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58A733858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699040414; bh=NC4ay0oF+5frpIG3t1FBN9k1aL3XmcphnMzn/tbmRRQ=; h=From:To:Subject:Date:From; b=gfF2a0H3lo6w4zeqBRlGVTIm88KJD6QX8O4oF2PCUo8TZHGIGb36v4rStRW8S/HXW yXFnOHD5vOxyjIHQhKDwcDqspwFUzrHyq2U+XIpo2Ent0jP9KWmYQRA4D+X8f6f7mo CrVDQzkZtoXk95BHakDn3XIkLXREJm0bFO32+W0Y= From: "dcb314 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/112373] New: cppcheck: libcpp/charset.cc: 3 * obvious performance issue Date: Fri, 03 Nov 2023 19:40:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dcb314 at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D112373 Bug ID: 112373 Summary: cppcheck: libcpp/charset.cc: 3 * obvious performance issue Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- A recent run of static analyser cppcheck over the source code of gcc trunk produces the following: libcpp/charset.cc:1908:56: performance: Function parameter 'cvt' should be passed by const reference. [passedByValue] libcpp/charset.cc:1962:55: performance: Function parameter 'cvt' should be passed by const reference. [passedByValue] libcpp/charset.cc:2063:55: performance: Function parameter 'cvt' should be passed by const reference. [passedByValue] The first one is tatic void emit_numeric_escape (cpp_reader *pfile, cppchar_t n, struct _cpp_strbuf *tbuf, struct cset_converter cvt) Suggest code rework.=