Re: [Lit.] Buffer overruns
From: Bill Unruh (unruh_at_string.physics.ubc.ca)
Date: 01/26/05
- Next message: jstevh_at_msn.com: "Reality check, surrogate factoring"
- Previous message: Larry Elmore: "Re: [Lit.] Buffer overruns"
- In reply to: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- Next in thread: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- Reply: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 26 Jan 2005 02:33:04 GMT
Mok-Kong Shen <mok-kong.shen@t-online.de> writes:
>infobahn wrote:
>> Mok-Kong Shen wrote:
>>
>>>Since you are at home even with C++ (with its in my humble
>>>view rather rich/wide extent of features/capabilities), that
>>>should be quite simple for you. I am pretty sure you would
>>>then revise your current viewpoint to certain degree.
>>
>>
>> I doubt it. I'm all for bounds-checking; I think it's vital.
>> I just don't think the runtime system should do it unnecessarily.
>That presumably depends on the quality of the compiler.
>A good compiler should be able to optimize (in general quite
>a lot) to save operations that are unnecessary (to certain
>possible extent, of course). I barely have knowledge in
>compiler techniques. But I would think that, if an array A
>is declared with index 1..10 and one has a loop on A[i]
>with i going from 1 to 10 (or a subrange of that), then the
>compiler should be smart enough not to create any code to
>do bound check. As said, if the programmer decides that
Of course then in the midst of the loop you have an
i+=100; A[i]=j;
( of course you meant to write j+=100, but...)
>certain checks are unnecessary (e.g. for reason that any
>potential bound problem in a particular region of the
>program is unessential according to his knowledge) he could
>explicitly instruct the compiler not to do the check in
>that region. (Not every region of a large software is
>safety critical in practice.)
>M. K. Shen
- Next message: jstevh_at_msn.com: "Reality check, surrogate factoring"
- Previous message: Larry Elmore: "Re: [Lit.] Buffer overruns"
- In reply to: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- Next in thread: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- Reply: Mok-Kong Shen: "Re: [Lit.] Buffer overruns"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|