Menu

#216 Generated code for QP version check violates MISRA-C Rule 10.1

QM
closed
None
1
2018-06-30
2018-06-22
No

The code generated by QM for checking the QP version compatibility violates MISRA-C:2004 Rule 10.1 "Implicit conversion changes signedness". This violation is reported by PC-Lint, for example:

/* Check for the minimum required QP version */
#if ((QP_VERSION < 630U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U)))
#error qpc version 6.3.0 or higher required
#endif

lint:960-> Violates MISRA 2004 Required Rule 10.1, Implicit conversion changes signedness

The problem comes from the "0x3E8" where an 'U' should be added, as well on the QP_VERSION should be defined as an unsigned constant (e.g., 630U).

--MMS

Discussion

  • Quantum Leaps

    Quantum Leaps - 2018-06-30
    • status: open --> closed
     
  • Quantum Leaps

    Quantum Leaps - 2018-06-30

    Fixed in QM 4.3.0 and QP 6.3.3.
    --MMS

     

Anonymous
Anonymous

Add attachments
Cancel