On Wed, 25 Oct 2017, Victor Porton wrote: > Do you agree that a release (that is software for which debugging was > finished) should have integer overflow tests but not array out of bounds > tests (because array out of bounds is always a programming error, but > integer overflow may happen in an innocent program)? Firstly, depending on your programming conventions (or style) either exception can be an error, or both, or none. As a rule of thumb, if the possibility for the exception is anticipated and the exception is handled, it is not an error. If you don't anticipate the exception to be raised, raising it is an error. Here a simple example for a program where an out-of-bounds access to an array is not an error, and skipping the check would break the program: with Ada.Text_IO; procedure Example is type Counter_Array is array (Character range <>) of Integer; Counter: Counter_Array('a' .. 'z') := (others => 0); begin while not Ada.Text_IO.End_Of_File loop declare C: Character; begin Ada.Text_IO.Get(C); Counter(C) := Counter(C) + 1; Ada.Text_IO.Put_Line(C & Integer'Image(Counter(C))); exception when others => null; end; end loop; for C in Counter'Range loop Ada.Text_IO.Put(Integer'Image(Counter(C))); end loop; end Example; Secondly, even if raising the exception is an error, why do you want to skip the check? Raising the exception gives you at least the chance to shut down your program cleanly (try to close files you opened ...) and to write some debugging output. Of course, if it turns out that your program is too slow, skipping either check may be an option. Ideally, you only do so after properly profiling your program and locally, for the parts of the program which are performance bottlenecks. Generally turning of some checks from scratch is premature optimization. (BTW, my general experience is that skipping overflow and out-of-bounds access checks improves the peformance only marginally.) -------- I love the taste of Cryptanalysis in the morning! -------- www.uni-weimar.de/de/medien/professuren/mediensicherheit/people/stefan-lucks ----Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany----