Setting /max On Variable in .sym Leads To Malformed Range In Generated C Code
See original GitHub issueThe following .sym
message:
FormatVersion=6.0 // Do not edit this line!
Title="Untitled"
{ENUMS}
Enum=Enum1()
{SIGNALS}
Sig=Signed_Int_Char char
Sig=Enum_Signal Enum1 8
{SENDRECEIVE}
[PDM_HeartBeat]
ID=001h
Len=8
Var=Variable1 unsigned 42,3 /max:1
produces the following struct
:
/**
* Signals in message PDM_HeartBeat.
*
* All signal values are as on the CAN bus.
*/
struct CanMsgs_pdm_heart_beat_t {
/**
* Range: ..1 (..1 -
* Scale: 1
* Offset: 0
*/
uint8_t variable1;
};
Note that the range is ..1 (..1 -
, where I would expect it to be something like * 0..1 (0..1 -)
? Looks like this is a case of /max
somehow being misinterpreted? What’s really confusing here is that the right value somehow makes it all the way from .sym
->internal database
->C source
, so I suspect this is a bug with C source generation?
Please let me know if you need anything else! Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Set assumption on symbolic object - MATLAB assume
Expression to set assumption on, specified as a symbolic variable, expression, vector, or matrix. If expr is a vector or matrix, then assume(expr,set)...
Read more >How would you set a variable to the largest number possible ...
Firstly, include a header file named as math.h · Now, equate INT_MAX to the integer whose value you want to set maximum. EXAMPLE:...
Read more >HI-TECH C Compiler for PIC18 MCUs - Microchip Technology
The driver instructs the code generator to preserve any C variables which map to symbols which are used, but not defined, ...
Read more >HI-TECH PICC Compiler - NI
Specify and/or reserve ROM ranges. --RUNTIME=type. Configure the C runtime libraries to the specified type. --SCANDEP. Generate file ...
Read more >HI-TECH PICC-18 STD Compiler - Datasheet Archive
2.4.5 -Gfile: Generate Source-level Symbol File . ... The code for max() in max.c will be linked into the program rather than the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed resolved in 32.5.3, thanks!
Fixed in 32.5.3, available on PyPI!