Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is rule 10.5 compliant with rule 10.3?
#4
MISRA-C meeting 23-8-2006

Quote:Rule 10.3 requires a \"complex expression\" of integer type only be explicitly cast to a NARROWER type.

Rule 10.5 requires that bitwise operator RESULT to be immediately cast to the underlying type (NOT a NARROWER type).

We agree that this is a contradiction.

10.5 should be treated as an exception to 10.3.

We are further considering this issue, since an alternative is to modify 10.3 to allow explicit casts to the same size or narrower. This has greater implications on allowing “redundant” casts, and requires further consideration.
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)