Programming error in QP/C++ posix port
Real-Time Event Frameworks based on active objects & state machines
Brought to you by:
quantum-leaps
It appears a bug in the posix port of QP/C++ was instroduced in version 6.7.0.
In version 6.6.0 the QActive::start function prototype included:
uint_fast16_t stkSize
But in version 6.7.0 it was changed to:
uint_fast16_t const stkSize
Later in the function we have the following:
// stack size not provided?
if (stkSize == 0U) {
// set the allowed minimum
stkSize = (uint_fast16_t)PTHREAD_STACK_MIN;
}
We get an error when compiling since we're trying to change a constant variable. Also it looks like this variable isn't actually used in the function. Maybe just a (void*)stkSize; at the top of the function?
Anonymous
Yes, this bug has been introduced while trying to satisfy MISRA complance (parameter could be defined
const). The bug will be fixed in the next upcoming QP/C++ 6.8.0.For now, the recommended fix is to remove the code:
And to add:
--MMS
Last edit: Quantum Leaps 2020-03-17
Thanks! Really appreciate the help!
Fixed in QP/C++ 6.8.0.
--MMS