Menu ▾ ▴

#405 QM 7.0.3 QP Version Check Issue

QM
open
nobody
None
1
22 hours ago
22 hours ago
Anonymous
No

We've identified an issue with the version check generated by QM 7.0.3 (Assumption is that 7.0.2 would have the same issue).

Namely, there is a mix between std::array and C-style arrays. QM 7.0.3 generates code with std::array, while QPCC older than 8.1.3 uses C style arrays.

Concretely, we've noticed the issue with
static constexpr struct {
QP::QMState const *target;
std::array<qp::qactionhandler, 2=""> act;
} tatbl_ = { // tran-action table ...</qp::qactionhandler,>

Generated, but later in
status_ = qm_tran(&tatbl_);

QState qm_tran(void const * const tatbl) noexcept {
m_temp.tatbl = static_cast<qp::qmtranacttable const="" *="">(tatbl);
return Q_RET_TRAN;
}</qp::qmtranacttable>

qm_tran casts it to QP::QMTranActTable

which is defined as
struct QMTranActTable {
QMState const *target;
QActionHandler const act[1];
};

At the same time, the the version check is:
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version

if (QP_VERSION < 800U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))

error qpcpp version 8.0.0 or higher required

endif

//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So, it is expected tha the code should work with anything higher than 8.0.0, but it should be 8.1.3.

Discussion

Anonymous
Anonymous

Add attachments
Cancel