Error message:
xxx.h:117:59: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive] int m_MinValidLen = (int)(&(((DataOnAir *)0)->rx_ts_s));
Reason for error:
This is because the pointer type occupies 8 bytes on the 64-bit system based on the Linux kernel, and the int type occupies 4 bytes, so there will be losses precision.
You can convert the int* to the long type first, and the long type can be implicitly converted to the int type. You can directly modify it to long long
or long
Modified:
long m_MinValidLen = (long)(&(((DataOnAir *)0)->rx_ts_s));
Read More:
- Keil :error: identifier “int8_ T “is undefined
- Keil : error: identifier “int8_ T “is undefined
- How to print how to output Int64_ t,uint64_ The value of T in C
- TypeError: int() can’t convert non-string with explicit base
- How to Solve Int Data overflow error
- Arithmetic overflow error converting identity to data type int
- Can’t multiply sequence by non int of type ‘float’
- Undefined reference to ‘CV:: imread (CV:: String const & int)’
- ERROR:expected initializer before “int”
- VxWorks parse error near int
- Debug | AttributeError: ‘numpy.int64‘ object has no attribute ‘to_pydatetime‘
- TypeError: unsupported operand type(s) for *: ‘range‘ and ‘int‘
- Type error: sequence item 0: expected STR instance, int found
- Python: How to Fix “Ord() expected string of length 1, but int found”
- The Vue elementui switch button uses an int type value
- go :Multiple-value strconv.Atoi() (int, error) in single-value context
- The reason and solution of the error of join function: sequence item 0: expected STR instance, int found
- In Java, int is converted to string, and zero is added before the number of bits is insufficient
- (-215:Assertion failed) 0 <= contourIdx && contourIdx < (int)last in function ‘cv::drawContours‘
- RuntimeError: ‘lengths’ argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor