23-08-2006, 10:10 AM
MISRA-C meeting 23-8-2006
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.
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