discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] runtime errors vs. logic errors


From: Nowlan, Sean
Subject: [Discuss-gnuradio] runtime errors vs. logic errors
Date: Mon, 16 Apr 2012 01:01:07 +0000

Kind of a nitpicky C++ thing, but shouldn’t argument checks on the access code in gr_correlate_access_code_tag_bb.cc throw std::invalid_argument or std::range_error, which are both derived from std::runtime_error, versus std::out_of_range, which is derived from std::logic_error? My understanding is that the latter is used for cases such as referencing index 11 in a string that was declared to have length 10, etc, whereas the former are used for checking user-supplied parameters. A quick “ find. | xargs grep out_of_range” yields the attached output. It looks like the uses in /src/lib/swig/guile/std_vector.i are correctly used (popping from an empty vector, referencing an out-of-bounds index, etc.) but the other cases should be invalid_argument. Thoughts? If this gets the go-ahead, I’ll make a patch sometime this week.

 

Thanks,

Sean


reply via email to

[Prev in Thread] Current Thread [Next in Thread]