From 1651444b27a6c437ab8395f19fe4a6609b6e2895 Mon Sep 17 00:00:00 2001 From: Marcus Müller Date: Sun, 18 Feb 2018 19:53:53 +0100 Subject: examples: replace `boost::format%(a,b)` by `(boost::format%a%b)` The former compiles to evaluating `a`, then throwing away the result, evaluating `b`, then using that to fill in the first placeholder in `format`. And that is wrong. Pointed to this by Clang++'s "unused result" warning. --- host/examples/twinrx_freq_hopping.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/examples') diff --git a/host/examples/twinrx_freq_hopping.cpp b/host/examples/twinrx_freq_hopping.cpp index 67a4d99f6..95affbf5b 100644 --- a/host/examples/twinrx_freq_hopping.cpp +++ b/host/examples/twinrx_freq_hopping.cpp @@ -153,7 +153,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ } if (start_freq < rx_freq_range.start() or end_freq > rx_freq_range.stop()) { throw uhd::runtime_error((boost::format("Start and stop frequencies must be between %d and %d MHz") - % ((rx_freq_range.start() / 1e6), (rx_freq_range.stop() / 1e6))).str()); + % (rx_freq_range.start() / 1e6) % (rx_freq_range.stop() / 1e6)).str()); } if (start_freq > end_freq) { throw uhd::runtime_error("Start frequency must be less than end frequency."); -- cgit v1.2.3