Frank Heckenbach wrote:
CBFalconer wrote:
... snip ...
PROGRAM whatever(...);
CONST maxint = 32767; (* redefine *) minint = -32768; TYPE integer = minint .. maxint; (* redefine *)
...
and away you go! These are NOT reserved words.
To be pedantic, you might want to write `MinInt = -MaxInt;' since the standard demands a symmetric range of Integer.
However, in GPC that's not exactly the same as `Integer (16)'. A subrange would still be a type of the same size as `Integer' (usually 32 bits) which is generally preferable for performance reasons, while strict BP compatibility sometimes requires a 16 bit type because some BP code relies on record layout etc.
While there is nothing wrong with that practice, I was always under the impression that the system was allowed to reduce the storage requirements for a subrange to whatever was needed. Without range checking the result is extremely dangerous, of course.
This is one reason I see no purpose in extensions that supply other integral forms. Internal operations then remain on integers, only storage is affected. I guess an exception would have to be made for integral forms that can handle things larger than the system optimum integer, but that doesn't apply to gpc since, AFAIK, it doesn't have any integral forms larger than 32 bits.