Integer promotion (MISRA C:2012 Rule 7.2)
问题 MISRA enforces the use of the U suffix for unsigned integer constants uint32_t the_answer = 0x42U; I feel the U is a bit boilerplate because the line is very understandable without it. So I am wondering how much this rule is important and if unsigned int x = 1 is truely a bad example of implicit integer promotion. 回答1: You are correct, the U in this specific example is superfluous as per an exception to Rule 10.3: "A non-negative integer constant expression of essentially signed type may be