MISRA Discussion Forums
What is the essential type of -123L? - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA C:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21)
+---- Forum: 8.10 The essential type model (https://forum.misra.org.uk/forumdisplay.php?fid=165)
+---- Thread: What is the essential type of -123L? (/showthread.php?tid=1153)



What is the essential type of -123L? - misra-c - 17-02-2015

When applying the essential type model, what is the essential type of "-123L"?


Re: What is the essential type of -123L? - misra-c - 17-02-2015

The last paragraph of section D.1 states that sections D.2 – D.7 only apply to expressions whose standard C type is "signed int" or"unsigned int".

The standard type of the expression “-123L” is "signed long", and hence the essential type is also "signed long".