Re: C++ Bounds Checking
- From: Gary Scott <garylscott@xxxxxxxxxxxxx>
- Date: Fri, 29 Jun 2007 17:01:38 GMT
Gordon Sande wrote:
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.
That was my impression of the feature, but I'm not language-design knowledgeable enough to make those sorts of public statements with confidence.
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.
--
Gary Scott
mailto:garylscott@sbcglobal dot net
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
If you want to do the impossible, don't hire an expert because he knows it can't be done.
-- Henry Ford
.
- References:
- C++ Bounds Checking
- From: Gary Scott
- Re: C++ Bounds Checking
- From: Beliavsky
- Re: C++ Bounds Checking
- From: Gary Scott
- Re: C++ Bounds Checking
- From: Gordon Sande
- C++ Bounds Checking
- Prev by Date: Re: SAVE
- Next by Date: Re: A question about OOP in Fortran?
- Previous by thread: Re: C++ Bounds Checking
- Next by thread: Re: C++ Bounds Checking
- Index(es):
Relevant Pages
|