Abstract
Let's get started? Integer overflows are exotic and dangerous beasts, that most programmers do not encounter very often, and tend to forget about. An integer overflow occurs when the result of an arithmetic computation does not fit in the machine integer type that needs to hold the result. Of course, Ada requires run-time checks to protect against integer overflows, which are enabled by the switch -gnato in GNAT. But it is common to compile without this switch for production binaries, in which case an integer overflow will result in what the Ada Reference Manual calls "erroneous behavior", which means that anything could happen (see Gems #132 to #135).
Recommendations
Gem #149: Asserting the truth, but (possibly) not the whole truth
Let's get started? In the beginning was created Ada. It did not have any assertions. Then came GNAT, which introduced pragma Assert. The ARG saw that it was good, and adopted it in Ada 2005. Then came GNAT again, which introduced pragma Precondition and ...
Gem #52: scripting capabilities in GNAT (Part 1)
Ada Gem #52 -- Programming languages are, at least in the mind of most programmers, divided into two categories: scripting languages and others. The dividing line is not always obvious, and generally has to do with the size of the application, whether ...
Gem #145: Ada Quiz 3 - Statements
Let's get started? Ada is an imperative programming language, where the sequentially executed statement is a building block of the language (together with declarations). This Gem presents nine short questions on Ada statements. Try to answer them ...






Comments