Doubts on underlying type of integer constant expressions.

Moderators: david ward, misra cpp

zaffanella
Posts: 5
Joined: Tue Jun 10, 2008 7:12 pm
Company: University of Parma (Italy)

Doubts on underlying type of integer constant expressions.

Postby zaffanella » Sun Sep 04, 2011 8:26 pm


misra cpp
Posts: 145
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Doubts on underlying type of integer constant expressions.

Postby misra cpp » Mon Oct 05, 2015 2:57 pm

Question 1:
The underlying type of "RED + 1" is the enum type. The comment on Page 60 does not apply to enums.

Question 2:
The underlying type of "1L" is indeed signed char. We will consider changing this to improve compatibility with MISRA C:2012.

Question 3:
The underlying type of "1UL" is unsigned char, so "-1UL" violates Rule 5-3-2.
Posted by and on behalf of
the MISRA C++ Working Group


Return to “6.5 Expressions (C++)”

Who is online

Users browsing this forum: No registered users and 1 guest