[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] runtime errors vs. logic errors
From: |
Tom Rondeau |
Subject: |
Re: [Discuss-gnuradio] runtime errors vs. logic errors |
Date: |
Thu, 19 Apr 2012 10:21:43 -0400 |
On Sun, Apr 15, 2012 at 9:02 PM, Nowlan, Sean
<address@hidden> wrote:
> Sorry for the re-post; forgot to include the attachment.
>
>
>
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Nowlan, Sean
> Sent: Sunday, April 15, 2012 9:01 PM
> To: address@hidden
> Subject: [Discuss-gnuradio] runtime errors vs. logic errors
>
>
>
> 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
Sean,
Sure, this makes sense. You're right that it's a bit nit-picky, but
you're technically correct, and we might as well attempt to be as
correct as possible whenever we can. We'll wait for your patch, but
probably apply it off of the master HEAD branch to go into 3.6.1.
Thanks,
Tom