Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
| vs || operator on C99 bool types
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Shao Miller, post: 4223551"] Forbidden? "... The rank of _Bool shall be less than the rank of all other standard integer types. ..."[6.3.1.1p1] That is a discussion which concludes with the definition of "the integer promotions." Then we have for '|'[6.5.12p3] that the "usual arithmetic conversions" are performed, which in this case includes the integer promotions[6.3.1.8p1]. So using '_Bool' doesn't appear to be forbidden. Perhaps your discussion partner believes that the construct "ought to be" ("should be" makes me think that something "is already true," given some reference) because any non-value bits in a '_Bool' are not very useful in a program. However the value is stored, it undergoes the integer promotions and is not longer a '_Bool' by the time it's used in the context you provide, as far as I understand it. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
| vs || operator on C99 bool types
Top