Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Underlying type of unary minus operator (-var)
#3
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:

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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)