INTEGER
ranges cannot be open: for example, as members in a SEQUENCE, ...
value INTEGER
... or ...
value INTEGER (0..MAX)
are not allowed, since MAX
can have ASN.1 tool-specific
semantics. To that end, the only INTEGER
statements allowed are the
ones with explicit ranges declared, i.e.
value INTEGER (123..789)
This is also necessary for another reason: the code generated for INTEGER
s
by an ASN.1 compiler (in our case, asn1Scc
9.1)
is able to carry specific ranges of INTEGER
s. In our case,
the target C type is long
. Depending on the implementation
platform, long
can carry anywhere from 32 to 128 bits; the Data Modeling
Toolchain knowns the target platform, and can therefore check whether
the range specified in the ASN.1 grammar is covered. If it is not,
a fatal error will be displayed during the translation, ...
INTEGER (in ...) must have a range constraint inside
ASN.1, or else we might lose accuracy during runtime!
... safeguarding
the system from undefined runtime behavior which would occur if an
attempt to store a value larger than long
is made somewhere
during the modeling process.
This error can be disabled by passing -ignoreINTEGERranges to the code generator. |