Skip to content

Commit 41348a2

Browse files
AndersKaloermarcusmueller
authored andcommitted
clang-tidy: misc-throw-by-value-catch-by-reference
Exceptions should be thrown by value and caught by reference. Closes gnuradio#2708
1 parent d50e7b5 commit 41348a2

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

gnuradio-runtime/lib/block_detail.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,8 @@ void block_detail::set_processor_affinity(const std::vector<int>& mask)
231231
if (threaded) {
232232
try {
233233
gr::thread::thread_bind_to_processor(thread, mask);
234-
} catch (std::runtime_error e) {
234+
} catch (std::runtime_error& e) {
235235
std::cerr << "set_processor_affinity: invalid mask." << std::endl;
236-
;
237236
}
238237
}
239238
}

gnuradio-runtime/lib/prefs.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void prefs::_read_files(const std::vector<std::string>& filenames)
110110
std::string value = o.value[0];
111111
d_config_map[section][key] = value;
112112
}
113-
} catch (std::exception e) {
113+
} catch (std::exception& e) {
114114
std::cerr << "WARNING: Config file '" << fname
115115
<< "' failed to parse:" << std::endl;
116116
std::cerr << e.what() << std::endl;

gr-uhd/lib/usrp_block_impl.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ bool usrp_block_impl::_unpack_chan_command(std::string& command,
238238
} else {
239239
return false;
240240
}
241-
} catch (pmt::wrong_type w) {
241+
} catch (pmt::wrong_type& w) {
242242
return false;
243243
}
244244
return true;

0 commit comments

Comments
 (0)