Comments (4)
from commsdsl.
Hi Melg,
I managed to spend a couple of hours this weekend on this issue and realized that the problem is rather in "commsdsl" code generator than the COMMS library (transferred the issue).
The quick fix for your problem would be adding sematicType="messageId"
property to the definition of the CommandType
enum.
The code generator generates MsgId.h
which are used for all the message definitions to specify their numeric IDs. The code generator looks for an enum with sematicType="messageId"
property set and takes the values from there it also assigns appropriate underlying type copied from the <enum>
definition itself. When no such field is found, then the MsgId is generated by accumulating all the numeric IDs of the defined messages (your case). The bug in commsdsl2comms code generator is that in such case it doesn't specify underlying type, which results in the reported UB.
Below is the quote from cppreference:
If the underlying type is not fixed and the source value is out of range, the result is unspecified (until C++17)undefined (since C++17).
Currently the "develop" branch of the commsdsl repo contains the fix, it puts the "unsigned" to be the underlying type of the MsgId enum in such case (reproduced and tested in test42 unittest).
Also note that I introduced multiple fixes to the develop branch of the COMMS library (mostly to the unittests themselves) and now all the unittests are passing with "address" + "undefined" sanitizers. I'll probably do small "patch" releases with the relevant fixes to the comms_champion and the commsdsl projects within a week or two.
from commsdsl.
That's awesome! Thanks for your work and quick responses!
from commsdsl.
Should be fixed in latest v3.5.3 release.
from commsdsl.
Related Issues (20)
- Question: List without length and message size HOT 2
- ICD generation HOT 7
- Missing copyright holder in license HOT 5
- ASN.1 Parsing/Serialization HOT 2
- Adding constexpr to static const functions HOT 2
- Bit Order in `<bitfield>` and `<set>` HOT 4
- `optional` field with `cond` depending on another `optional` field. HOT 7
- Field Extension Support in Lists with termSuffix HOT 4
- Need Help HOT 21
- Creating Frame with `id` that is less than one byte HOT 3
- Can a (serial) protocol with character escaping be realized using the custom code feature? HOT 2
- Schema name cannot start with a capital HOT 4
- Select variant based on value in the transport frame HOT 1
- noexcept error with gcc 9 HOT 5
- Unexpected max serialisation length HOT 4
- Dead links in the Readme HOT 1
- vcpkg integration HOT 16
- error when using COMMSDSL_NO_TESTS HOT 2
- "Unexpected max serialisation length" on variable length field inside variant HOT 6
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 commsdsl.