<div dir="auto"><div>Any suggestions on how to address these?<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <span dir="auto"><<a href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a>></span><br>Date: Sun, Dec 24, 2023, 1:18 PM<br>Subject: New Defects reported by Coverity Scan for RTEMS-Tools<br>To: <<a href="mailto:joel.sherrill@gmail.com">joel.sherrill@gmail.com</a>><br></div><br><br>Hi,<br>
<br>
Please find the latest report on new defect(s) introduced to RTEMS-Tools found with Coverity Scan.<br>
<br>
39 new defect(s) introduced to RTEMS-Tools found with Coverity Scan.<br>
12 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.<br>
<br>
New defect(s) Reported-by: Coverity Scan<br>
Showing 20 of 39 defect(s)<br>
<br>
<br>
** CID 1574966: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_i386.cc: 17 in Target::Target_i386::Target_i386(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574966: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_i386.cc: 17 in Target::Target_i386::Target_i386(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
11 #include <string.h><br>
12 #include <unistd.h><br>
13 <br>
14 namespace Target {<br>
15 <br>
16 Target_i386::Target_i386( std::string targetName ):<br>
>>> CID 1574966: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::TargetBase::TargetBase(std::__cxx11::string)" when it could be moved instead.<br>
17 TargetBase( targetName )<br>
18 {<br>
19 conditionalBranchInstructions.push_back("ja");<br>
20 conditionalBranchInstructions.push_back("jb");<br>
21 conditionalBranchInstructions.push_back("jc");<br>
22 conditionalBranchInstructions.push_back("je");<br>
<br>
** CID 1574965: (COPY_INSTEAD_OF_MOVE)<br>
/rtemstoolkit/pkgconfig.cpp: 90 in pkgconfig::package::load(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)()<br>
/rtemstoolkit/pkgconfig.cpp: 92 in pkgconfig::package::load(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574965: (COPY_INSTEAD_OF_MOVE)<br>
/rtemstoolkit/pkgconfig.cpp: 90 in pkgconfig::package::load(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)()<br>
84 <br>
85 if (d != std::string::npos)<br>
86 {<br>
87 std::string lhs = rld::tolower (line.substr (0, d));<br>
88 std::string rhs = line.substr (d + 1);<br>
89 if (def)<br>
>>> CID 1574965: (COPY_INSTEAD_OF_MOVE)<br>
>>> "rhs" is copied in a call to copy assignment "operator =", when it could be moved instead.<br>
90 defines[lhs] = rhs;<br>
91 else<br>
92 fields[lhs] = rhs;<br>
93 }<br>
94 }<br>
95 }<br>
/rtemstoolkit/pkgconfig.cpp: 92 in pkgconfig::package::load(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)()<br>
86 {<br>
87 std::string lhs = rld::tolower (line.substr (0, d));<br>
88 std::string rhs = line.substr (d + 1);<br>
89 if (def)<br>
90 defines[lhs] = rhs;<br>
91 else<br>
>>> CID 1574965: (COPY_INSTEAD_OF_MOVE)<br>
>>> "rhs" is copied in a call to copy assignment "operator =", when it could be moved instead.<br>
92 fields[lhs] = rhs;<br>
93 }<br>
94 }<br>
95 }<br>
96 <br>
97 in.close ();<br>
<br>
** CID 1574964: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/covoar.cc: 142 in createBuildPath(std::__cxx11::list<Coverage::ExecutableInfo *, std::allocator<Coverage::ExecutableInfo *>> &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574964: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/covoar.cc: 142 in createBuildPath(std::__cxx11::list<Coverage::ExecutableInfo *, std::allocator<Coverage::ExecutableInfo *>> &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &)()<br>
136 for ( ; pri != eparts.rend(); ++pri )<br>
137 bparts.insert(bparts.begin(), *pri);<br>
138 <br>
139 std::string thisBuildPath;<br>
140 rld::path::path_join( thisBuildPath, bparts, thisBuildPath );<br>
141 if ( buildPath.empty() ) {<br>
>>> CID 1574964: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "thisBuildPath" is copied in a call to copy assignment "operator =", when it could be moved instead.<br>
142 buildPath = thisBuildPath;<br>
143 } else {<br>
144 if ( buildPath != thisBuildPath ) {<br>
145 fail = "executable build path does not match: " + buildPath;<br>
146 }<br>
147 }<br>
<br>
** CID 1574963: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/linkers/rtems-exeinfo.cpp: 757 in rld::exeinfo::func_count::func_count(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574963: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/linkers/rtems-exeinfo.cpp: 757 in rld::exeinfo::func_count::func_count(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)()<br>
751 {<br>
752 std::string name;<br>
753 int count;<br>
754 size_t size;<br>
755 <br>
756 func_count (std::string name, size_t size)<br>
>>> CID 1574963: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "name" is copied in call to copy constructor "std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >", when it could be moved instead.<br>
757 : name (name),<br>
758 count (1),<br>
759 size (size) {<br>
760 }<br>
761 };<br>
762 typedef std::vector < func_count > func_counts;<br>
<br>
** CID 1574962: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_powerpc.cc: 87 in Target::Target_powerpc_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574962: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_powerpc.cc: 87 in Target::Target_powerpc_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
81 }<br>
82 <br>
83 TargetBase *Target_powerpc_Constructor(<br>
84 std::string targetName<br>
85 )<br>
86 {<br>
>>> CID 1574962: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::Target_powerpc::Target_powerpc(std::__cxx11::string)" when it could be moved instead.<br>
87 return new Target_powerpc( targetName );<br>
88 }<br>
89 <br>
<br>
** CID 1574961: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_arm.cc: 129 in Target::Target_arm_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574961: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_arm.cc: 129 in Target::Target_arm_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
123 }<br>
124 <br>
125 TargetBase *Target_arm_Constructor(<br>
126 std::string targetName<br>
127 )<br>
128 {<br>
>>> CID 1574961: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::Target_arm::Target_arm(std::__cxx11::string)" when it could be moved instead.<br>
129 return new Target_arm( targetName );<br>
130 }<br>
131 <br>
<br>
** CID 1574960: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_riscv.cc: 81 in Target::Target_riscv_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574960: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_riscv.cc: 81 in Target::Target_riscv_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
75 }<br>
76 <br>
77 TargetBase *Target_riscv_Constructor(<br>
78 std::string targetName<br>
79 )<br>
80 {<br>
>>> CID 1574960: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::Target_riscv::Target_riscv(std::__cxx11::string)" when it could be moved instead.<br>
81 return new Target_riscv( targetName );<br>
82 }<br>
<br>
** CID 1574959: Insecure data handling (TAINTED_SCALAR)<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574959: Insecure data handling (TAINTED_SCALAR)<br>
/rtemstoolkit/rld-elf.cpp: 562 in rld::elf::file::begin(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &, int, bool, rld::elf::file*, long)()<br>
556 writable = writable_;<br>
557 elf_ = elf__;<br>
558 <br>
559 if (!archive && !writable)<br>
560 {<br>
561 load_header ();<br>
>>> CID 1574959: Insecure data handling (TAINTED_SCALAR)<br>
>>> Passing tainted expression "this->ehdr" to "load_sections", which uses it as a loop boundary.<br>
562 load_sections ();<br>
563 }<br>
564 }<br>
565 <br>
566 void<br>
567 file::end ()<br>
<br>
** CID 1574958: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/linkers/rtems-exeinfo.cpp: 473 in rld::exeinfo::image::output_compilation_unit(bool, bool)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574958: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/linkers/rtems-exeinfo.cpp: 473 in rld::exeinfo::image::output_compilation_unit(bool, bool)()<br>
467 std::cout << std::endl;<br>
468 <br>
469 if (objects)<br>
470 {<br>
471 std::cout << " Object files: " << cus.size () << std::endl;<br>
472 <br>
>>> CID 1574958: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "common_flags" is copied in call to copy constructor "std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >", when it could be moved instead.<br>
473 rld::strings filter_flags = common_flags;<br>
474 filter_flags.insert (filter_flags.end (),<br>
475 flag_exceptions.begin (),<br>
476 flag_exceptions.end());<br>
477 <br>
478 for (auto& p : producers)<br>
<br>
** CID 1574957: Memory - illegal accesses (UNINIT)<br>
/rtemstoolkit/libiberty/cplus-dem.c: 196 in cplus_demangle()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574957: Memory - illegal accesses (UNINIT)<br>
/rtemstoolkit/libiberty/cplus-dem.c: 196 in cplus_demangle()<br>
190 {<br>
191 ret = dlang_demangle (mangled, options);<br>
192 if (ret)<br>
193 return ret;<br>
194 }<br>
195 <br>
>>> CID 1574957: Memory - illegal accesses (UNINIT)<br>
>>> Using uninitialized value "ret".<br>
196 return (ret);<br>
197 }<br>
198 <br>
199 /* Demangle ada names. The encoding is documented in gcc/ada/exp_dbug.ads. */<br>
200 <br>
201 char *<br>
<br>
** CID 1574956: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574956: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
/rtemstoolkit/SimpleIni.h: 2104 in CSimpleIniTempl<char, SI_GenericCase<char>, SI_ConvertA<char>>::AddEntry(const char *, const char *, const char *, const char *, bool, bool)()<br>
2098 // because we will be inserting the key next<br>
2099 rc = CopyString(a_pKey);<br>
2100 if (rc < 0) return rc;<br>
2101 }<br>
2102 <br>
2103 // we always need a copy of the value<br>
>>> CID 1574956: Memory - corruptions (ARRAY_VS_SINGLETON)<br>
>>> Passing "a_pValue" via argument "a_pValue" to function "CopyString" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.<br>
2104 rc = CopyString(a_pValue);<br>
2105 if (rc < 0) return rc;<br>
2106 }<br>
2107 <br>
2108 // create the key entry<br>
2109 if (iKey == keyval.end() || bForceCreateNewKey) {<br>
<br>
** CID 1574955: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/linkers/rtems-exeinfo.cpp: 1123 in main()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574955: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/linkers/rtems-exeinfo.cpp: 1123 in main()<br>
1117 if (rld::verbose ())<br>
1118 std::cout << "exe-image: " << exe_name << std::endl;<br>
1119 <br>
1120 /*<br>
1121 * Open the executable and read the symbols.<br>
1122 */<br>
>>> CID 1574955: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "exe_name" is passed-by-value as parameter to "rld::exeinfo::image::image(std::__cxx11::string, bool)" when it could be moved instead.<br>
1123 rld::exeinfo::image exe (exe_name, inlined | dwarf_data);<br>
1124 <br>
1125 std::cout << "exe: " << <a href="http://exe.exe.name" rel="noreferrer noreferrer" target="_blank">exe.exe.name</a> ().full () << std::endl<br>
1126 << std::endl;<br>
1127 <br>
1128 /*<br>
<br>
** CID 1574954: Error handling issues (CHECKED_RETURN)<br>
/tester/covoar/ObjdumpProcessor.cc: 187 in Coverage::ObjdumpProcessor::determineLoadAddress(Coverage::ExecutableInfo *)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574954: Error handling issues (CHECKED_RETURN)<br>
/tester/covoar/ObjdumpProcessor.cc: 187 in Coverage::ObjdumpProcessor::determineLoadAddress(Coverage::ExecutableInfo *)()<br>
181 loadAddressFile.close();<br>
182 std::ostringstream what;<br>
183 what << "library " << Library << " not found in " << dlinfoName;<br>
184 throw rld::error( what, METHOD );<br>
185 }<br>
186 <br>
>>> CID 1574954: Error handling issues (CHECKED_RETURN)<br>
>>> Calling "sscanf" without checking return value (as is done elsewhere 5 out of 6 times).<br>
187 sscanf( inputBuffer, "%s %x", inLibName, &offset );<br>
188 std::string tmp = inLibName;<br>
189 if ( tmp.find( Library ) != tmp.npos ) {<br>
190 // std::cerr << inLibName << " - 0x"<br>
191 // << std::setfill( '0' ) << std::setw( 8 ) << std::hex<br>
192 // << offset << std::endl<br>
<br>
** CID 1574953: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/rtemstoolkit/rld-rap.cpp: 770 in rld::rap::section_merge::operator ()(const rld::files::section &)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574953: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/rtemstoolkit/rld-rap.cpp: 770 in rld::rap::section_merge::operator ()(const rld::files::section &)()<br>
764 osection osec (<a href="http://fsec.name" rel="noreferrer noreferrer" target="_blank">fsec.name</a>,<br>
765 offset,<br>
766 fsec.size,<br>
767 fsec.alignment,<br>
768 fsec.relocs.size (),<br>
769 fsec.flags);<br>
>>> CID 1574953: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "osec" is copied in a call to copy assignment "operator =", when it could be moved instead.<br>
770 sec.osecs[fsec.index] = osec;<br>
771 sec.osindexes.push_back (fsec.index);<br>
772 <br>
773 uint32_t rc = 0;<br>
774 <br>
775 for (files::relocations::const_iterator fri = fsec.relocs.begin ();<br>
<br>
** CID 1574952: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/TraceConverter.cc: 161 in main()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574952: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/TraceConverter.cc: 161 in main()<br>
155 }<br>
156 <br>
157 <br>
158 // Create toolnames.<br>
159 try<br>
160 {<br>
>>> CID 1574952: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "cpuname" is passed-by-value as parameter to "TargetFactory" when it could be moved instead.<br>
161 targetInfo.reset( Target::TargetFactory( cpuname ) );<br>
162 }<br>
163 catch ( rld::error re )<br>
164 {<br>
165 std::cerr << "error: "<br>
166 << re.where << ": " << re.what<br>
<br>
** CID 1574951: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_lm32.cc: 18 in Target::Target_lm32::Target_lm32(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574951: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_lm32.cc: 18 in Target::Target_lm32::Target_lm32(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
12 #include <algorithm><br>
13 <br>
14 namespace Target {<br>
15 <br>
16 // <a href="https://u15810271.ct.sendgrid.net/ls/click?upn=CTPegkVN6peWFCMEieYYmAy3X1jegPeWnxto7pNG35nvvR6RgfL-2BxTLFiyfH-2FOC7RuMZgjRkyIQlYzGf01lv2g-3D-3D-i1m_CTvEjVoKhyc6dLmJJo1u9AYIk8P8bcAbCPbBDYvYSXplrMrcL1gVgjbDyqPn4TwEJGFQgIP77zMUv4YPivzop50JtnsASbHLw76yRmZ6e4MurOPGecuvmjqOPnprCJ8VLiNfx8WaLxxU5NtnRNDfl0Wvu6xgN9yGxe4BiLE10r8iN-2BsjbHAJ4ay4txs4fMJF0VMXOnlSfjg7E3-2BC3vmDEf5PbAJjfqzYwkeCEq5NFho-3D" rel="noreferrer noreferrer" target="_blank">https://u15810271.ct.sendgrid.net/ls/click?upn=CTPegkVN6peWFCMEieYYmAy3X1jegPeWnxto7pNG35nvvR6RgfL-2BxTLFiyfH-2FOC7RuMZgjRkyIQlYzGf01lv2g-3D-3D-i1m_CTvEjVoKhyc6dLmJJo1u9AYIk8P8bcAbCPbBDYvYSXplrMrcL1gVgjbDyqPn4TwEJGFQgIP77zMUv4YPivzop50JtnsASbHLw76yRmZ6e4MurOPGecuvmjqOPnprCJ8VLiNfx8WaLxxU5NtnRNDfl0Wvu6xgN9yGxe4BiLE10r8iN-2BsjbHAJ4ay4txs4fMJF0VMXOnlSfjg7E3-2BC3vmDEf5PbAJjfqzYwkeCEq5NFho-3D</a><br>
17 Target_lm32::Target_lm32( std::string targetName ):<br>
>>> CID 1574951: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::TargetBase::TargetBase(std::__cxx11::string)" when it could be moved instead.<br>
18 TargetBase( targetName )<br>
19 {<br>
20 conditionalBranchInstructions.push_back("be");<br>
21 conditionalBranchInstructions.push_back("bge");<br>
22 conditionalBranchInstructions.push_back("bgeu");<br>
23 conditionalBranchInstructions.push_back("bg");<br>
<br>
** CID 1574950: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_aarch64.cc: 21 in Target::Target_aarch64::Target_aarch64(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574950: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_aarch64.cc: 21 in Target::Target_aarch64::Target_aarch64(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
15 #include "qemu-traces.h"<br>
16 #include "Target_aarch64.h"<br>
17 <br>
18 namespace Target {<br>
19 <br>
20 Target_aarch64::Target_aarch64( std::string targetName ):<br>
>>> CID 1574950: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::TargetBase::TargetBase(std::__cxx11::string)" when it could be moved instead.<br>
21 TargetBase( targetName )<br>
22 {<br>
23 conditionalBranchInstructions.push_back("cbnz");<br>
24 conditionalBranchInstructions.push_back("cbz");<br>
25 conditionalBranchInstructions.push_back("tbnz");<br>
26 conditionalBranchInstructions.push_back("tbz");<br>
<br>
** CID 1574949: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_lm32.cc: 49 in Target::Target_lm32_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574949: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/Target_lm32.cc: 49 in Target::Target_lm32_Constructor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()<br>
43 }<br>
44 <br>
45 TargetBase *Target_lm32_Constructor(<br>
46 std::string targetName<br>
47 )<br>
48 {<br>
>>> CID 1574949: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetName" is passed-by-value as parameter to "Target::Target_lm32::Target_lm32(std::__cxx11::string)" when it could be moved instead.<br>
49 return new Target_lm32( targetName );<br>
50 }<br>
51 <br>
<br>
** CID 1574948: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/covoar.cc: 430 in covoar(int, char **)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574948: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/tester/covoar/covoar.cc: 430 in covoar(int, char **)()<br>
424 coverageFormat = Coverage::CoverageFormatToEnum( format );<br>
425 coverageReader = Coverage::CreateCoverageReader( coverageFormat );<br>
426 if ( !coverageReader ) {<br>
427 throw rld::error( "Unable to create coverage file reader", "covoar" );<br>
428 }<br>
429 <br>
>>> CID 1574948: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "targetInfo" is copied in a call to copy assignment "operator =", when it could be moved instead.<br>
430 coverageReader->targetInfo_m = targetInfo;<br>
431 <br>
432 // Prepare each executable for analysis.<br>
433 for ( auto& exe : executablesToAnalyze ) {<br>
434 if ( verbose ) {<br>
435 std::cerr << "Extracting information from: " << exe->getFileName()<br>
<br>
** CID 1574947: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/trace/record/record-client-base.cc: 139 in ConfigFile::INIHandler(void *, const char *, const char *, const char *)()<br>
<br>
<br>
________________________________________________________________________________________________________<br>
*** CID 1574947: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
/trace/record/record-client-base.cc: 139 in ConfigFile::INIHandler(void *, const char *, const char *, const char *)()<br>
133 if (it != self->parser_.end()) {<br>
134 std::string error = (*it->second.first)(it->second.second, name, value);<br>
135 if (error == kNoError) {<br>
136 return 1;<br>
137 }<br>
138 <br>
>>> CID 1574947: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)<br>
>>> "error" is copied in a call to copy assignment "operator =", when it could be moved instead.<br>
139 self->error_ = error;<br>
140 } else {<br>
141 self->error_ = std::string("unknown section: ") + section;<br>
142 }<br>
143 <br>
144 return 0;<br>
<br>
<br>
________________________________________________________________________________________________________<br>
To view the defects in Coverity Scan visit, <a href="https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQi8c7-2B1U0roIV5G3HXifs2sikLj2FV5O7uu1zqO3oUQQ-3Dr51O_CTvEjVoKhyc6dLmJJo1u9AYIk8P8bcAbCPbBDYvYSXplrMrcL1gVgjbDyqPn4TwEJGFQgIP77zMUv4YPivzop78Qx7Rq9wmqxwai52XAjlPpqDyI-2BM5qd0tjepo7gLLI8gY46ZkHCEVowsPB6fM1W8bVwYbsKW9LP8zNrenbYnND87xhqFqdy6SdJdkYYHWNvwE1oZdPVavb9Yp6ZxBPe-2BqH5yodkECGxLpxwRoEEsI-3D" rel="noreferrer noreferrer" target="_blank">https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQi8c7-2B1U0roIV5G3HXifs2sikLj2FV5O7uu1zqO3oUQQ-3Dr51O_CTvEjVoKhyc6dLmJJo1u9AYIk8P8bcAbCPbBDYvYSXplrMrcL1gVgjbDyqPn4TwEJGFQgIP77zMUv4YPivzop78Qx7Rq9wmqxwai52XAjlPpqDyI-2BM5qd0tjepo7gLLI8gY46ZkHCEVowsPB6fM1W8bVwYbsKW9LP8zNrenbYnND87xhqFqdy6SdJdkYYHWNvwE1oZdPVavb9Yp6ZxBPe-2BqH5yodkECGxLpxwRoEEsI-3D</a><br>
<br>
To manage Coverity Scan email notifications for "<a href="mailto:joel.sherrill@gmail.com" target="_blank" rel="noreferrer">joel.sherrill@gmail.com</a>", click <a href="https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxTJDdEZ5ceQ-2BXdf-2FM1tcMIXP73MN3HxQfFTMLU5dSe8Rv0KFh7gYStOFjZD12ucRRnrjyUHOCTj7rG0E9HBcwa9CE8CGpcthnaEEfHiFVPqc-3DKn5A_CTvEjVoKhyc6dLmJJo1u9AYIk8P8bcAbCPbBDYvYSXplrMrcL1gVgjbDyqPn4TwEJGFQgIP77zMUv4YPivzop3StJ00M1Ne12rejWGRMHReDp1tAzcd9olZbutPxm-2B2n7Anpbm8G8Oswkyky1m2TxYRnMu3rgRq6wynbMBSZp-2BNK4umB8vezbiXcg7XvrIGIw2QDLw4lPBYFOPJpUwC0IULXbHeGJ8XvULTcqCIdPu4-3D" rel="noreferrer noreferrer" target="_blank">https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxTJDdEZ5ceQ-2BXdf-2FM1tcMIXP73MN3HxQfFTMLU5dSe8Rv0KFh7gYStOFjZD12ucRRnrjyUHOCTj7rG0E9HBcwa9CE8CGpcthnaEEfHiFVPqc-3DKn5A_CTvEjVoKhyc6dLmJJo1u9AYIk8P8bcAbCPbBDYvYSXplrMrcL1gVgjbDyqPn4TwEJGFQgIP77zMUv4YPivzop3StJ00M1Ne12rejWGRMHReDp1tAzcd9olZbutPxm-2B2n7Anpbm8G8Oswkyky1m2TxYRnMu3rgRq6wynbMBSZp-2BNK4umB8vezbiXcg7XvrIGIw2QDLw4lPBYFOPJpUwC0IULXbHeGJ8XvULTcqCIdPu4-3D</a><br>
<br>
</div></div></div>