Talk:Bounds checking

Impact
It'd be good if it was discussed what could happen without bounds checking and why this may be dangerous. --Abdull 10:35, 5 November 2005 (UTC)

Different usages
The article on bounds checking treats the subject as being the same as index checking, but this is not so. Index checking is a subset of bounds checking in that a variable used for indexing an array is checked for having values within the bounds of the array it is being used to index, and different arrays might well have different bounds even though the same variable is used to index them. However, bounds checking is more general and more closely associated with the variable, whereby a value about to be assigned to a variable would be checked for being within the allowed bounds for that variable. A simple situation would be an expression calculated as a 32-bit integer to be stored into a 16-bit variable. Some languages allow a variable to be declared with a specified allowable range (say -3 to 76, or 2.71828 to 3.14159 perhaps, though probably not with more complex ranges) so it is not just a matter of word sizes and suchlike.

"Many programming languages, such as C, never perform automatic bounds checking to raise speed"

This is the STUPIDEST thing I heard today. I know of at least 2 popular implementations (GCC and clang with the *sanitiser) that allow bounds checking under certain compiler option and at least one that does it automatically. — Preceding unsigned comment added by 178.128.114.180 (talk) 15:46, 20 March 2016 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified 1 one external link on Bounds checking. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20131203031224/http://www.owasp.org.cn/OWASP_Conference/2011/17_.pdf to http://www.owasp.org.cn/OWASP_Conference/2011/17_.pdf

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).

Cheers.— InternetArchiveBot  (Report bug) 16:27, 6 November 2016 (UTC)

JS++ existent types
"The JS++ programming language is able to analyze if an array index or map key is out-of-bounds at compile time using existent types, which is a nominal type describing whether the index or key is within-bounds or out-of-bounds and guides code generation. Existent types have been shown to add only 1ms overhead to compile times."

Unless I misunderstand JS++'s "existent types", these are exactly option/optional types from other languages like Haskell, Java, Rust, etc. The above quote is misleading in this case, as it's not actually doing any compile time analysis beyond basic type checking - all bounds checking is still done at run time. Also don't see the point in mentioning compile times here - the compiler is doing almost no extra work, so it makes since that it would take an insignificant amount of time.

2601:646:C900:2037:B4B6:2ED8:734B:FB5B (talk) 05:21, 4 February 2019 (UTC)

How bounds checking relates to the higher-level concept of constraints
Can someone please add this? Thanks in advance. 93.185.30.41 (talk) 19:18, 4 October 2019 (UTC)