Comments (1)
Hi Iulian.
Unfortunately it's not as easy as it seems. The run-time library (RTL) code has been implemented using this as a basis - that integers are mapped in a "large enough" form for pretty much all actions. If we had chosen to be more optimal in mapping INTEGER declarations to the "smallest C integer type that can accommodate them", then the interaction between RTL functions would be more complex - especially in light of code that is safety critical and must pass through compilations and static analysis tools without any warnings (encoding functions like those in asn1crt.c would have to be declared for each target "zone" - and the proper ones selected during code generation, etc). This is all the more important for SPARK/Ada outputs, where the interaction between different "bit-width" values would make things even more complex.
In the end, as with all things, this is a balancing act - the decision to use a common representation makes things much simpler to reason about. And for the uses targeted by ASN1SCC, what matters is the result of encoding (that ends up transmitted across communication lines) - where indeed, ranges are taken very much into account: an INTEGER(0..15) will only need 4 bits "on the wire" in UPER encodings, etc.
from asn1scc.
Related Issues (20)
- [SCALA] wrong method call HOT 2
- typedef byte compatibility issue HOT 1
- [Feature request] "Namespaced" include paths HOT 1
- Lack of two declarations HOT 1
- C global constant variable name collision HOT 2
- PER Real codec does not handle special cases according to standard HOT 1
- ACN optional choice with determinant HOT 5
- ACN optional choice with determinant and present-when HOT 2
- Failure when encoding/decoding messages in Streaming Mode with large Bit Strings (and smaller BitStream buffers) HOT 3
- Function optimisation in the RTL HOT 2
- Support for Explicit Bit Naming in XML Output and Python/XML Backends HOT 1
- --field-prefix AUTO Flag Causes Command to Hang HOT 1
- XER decoding and -slim
- pErrCode not set in ACN decoder for OCTET STRING with external size HOT 1
- Telecommunications support HOT 1
- Append Functions are not hierarchical
- ACN Support for Simple Arithmetic on Size Determinant Values HOT 1
- Inefficient and Incorrect Generated Code for CHOICEs HOT 1
- BOOLEAN ACN Encoding Issue HOT 1
- BOOLEAN with true-value check swapped HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asn1scc.