24-09-2008, 09:10 AM
The result of applying a unary minus to an operand of unsigned int is unsigned int according to the C standard.
Similarly, for the purpose of completing the concept of underlying type, the following applies:
However, Rule 12.9 applies and an expression of this type should be viewed with suspicion.
[ID:0000008]
Similarly, for the purpose of completing the concept of underlying type, the following applies:
Quote:The underlying type which results from the unary minus operator is the underlying type of the operand.
However, Rule 12.9 applies and an expression of this type should be viewed with suspicion.
[ID:0000008]
Posted by and on behalf of the MISRA C Working Group