Looking at this answer and knowing that 0 is an octal constant:
For hexadecimal [constants [and octal according to the comments]], it is the first type the value can fit in:
int,unsigned int,long,unsigned long,long long,unsigned long long
Therefore, I deduce this does not need a cast:
size_t foo = 0;
However, due to a strict MISRA-C lint tool, I get back a message about an illegal implicit type conversion - MISRA-C:2004 Rule 10.1.
Is my understanding wrong, or is the tool in error?
(NB: I've changed to size_t foo = 0U; as that is a lot simpler than arguing with QA, but I'd like to satisfy my own curiosity.)