Re: C++ Bounds Checking
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Fri, 29 Jun 2007 12:28:47 GMT
On 2007-06-28 23:54:54 -0300, Gary Scott <garylscott@xxxxxxxxxxxxx> said:
Beliavsky wrote:
On Jun 28, 8:43 pm, Gary Scott <garylsc...@xxxxxxxxxxxxx> wrote:The stated reason for the difference in the article I read was so that programmers could directly control in code whether automatic checking occurred or not.
I probably don't have the syntax correct, but I read recently that you
can force bounds checking on an array by expressing an access something
like:
array.at[i]
whereas:
array[i]
would not cause bounds checking
I wonder if you are thinking of the vector container in the C++
standard library, which can be substituted for the array of C/C++ in
some cases.
Would something like that be useful in Fortran? Seems sort of kludgy
and partially redundant to me.
Good compilers have done checked for some time, and assumed shape
arrays "know their own size", so one can determine the dimensions of
array arguments of procedures. The C++ vector, unlike the C/C++ array,
has a similar feature.
Excuse my cynicism but it sure sounds like some overly macho hacker wants
his debugging run to completion in 29 seconds instead of 35 seconds and is
willing to waste 3 days effort to achieve that. And it will turn out that
the out of bound subscript occurs somewhere that is not being checked
so another 6 days will be taken to track that down. And he can then brag
about how hard it was to find the bug and squash it.
If the problem occurred where you thought it was it would not be a problem.
.
- Follow-Ups:
- Re: C++ Bounds Checking
- From: Gary Scott
- Re: C++ Bounds Checking
- References:
- C++ Bounds Checking
- From: Gary Scott
- Re: C++ Bounds Checking
- From: Beliavsky
- Re: C++ Bounds Checking
- From: Gary Scott
- C++ Bounds Checking
- Prev by Date: Re: Need Help: compiling old Fortran program
- Next by Date: Re: Codes using F2003 C binding
- Previous by thread: Re: C++ Bounds Checking
- Next by thread: Re: C++ Bounds Checking
- Index(es):
Relevant Pages
|