Y334275 opened a new issue, #17992:
URL: https://github.com/apache/nuttx/issues/17992
### Description
When I was trying to replace the NuttX version that PX4 depends on with
12.12, I encountered some compilation errors. Here is the specific compilation
error:
```
PX4-Autopilot/src/modules/navigator/mission_base.cpp:76:60: error: no
matching function for call to 'constrain(int32_t&, long long int, long int)'
76 | const int32_t start_index =
`math::constrain`(_mission.current_seq, `INT32_C(0)`, int32_t(_mission.count) -
1);
|
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors
```
In this case, math::constrain is a template function that expects all
arguments to be of a single type (which should be int32_t here). However, the
type of INT32_C(0) is not int32_t.
I searched for INT32_C and found its definition in
arch/xtensa/include/inttypes.h:
```c
#define INT32_C(x) x ## ll
#define INT64_C(x) x ## ll
```
This shows its definition is the same as INT64_C, both being long long int.
But the _int32_t defined in xtensa is long int (in
arch/xtensa/include/types.h). Is this a mistake?
### Verification
- [x] I have verified before submitting the report.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]