https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112373

            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.

Reply via email to