This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/66938] New: using bool as destination in overflow checkers
- From: "rv at rasmusvillemoes dot dk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 Jul 2015 21:48:07 +0000
- Subject: [Bug c/66938] New: using bool as destination in overflow checkers
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66938
Bug ID: 66938
Summary: using bool as destination in overflow checkers
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: rv at rasmusvillemoes dot dk
Target Milestone: ---
Playing around with the __builtin_*_overflow checkers, I noticed that when the
third argument is pointer to _Bool one gets "error: argument 3 in call to
function '__builtin_add_overflow' does not have pointer to integer type".
Technically, _Bool _is_ an integer type.
I can't really think of a situation where one would want to do arithmetic on
_Bools, or to know if the result of a computation is 0 or 1, so this is mostly
about the wording of the error message [also, "does not have" should probably
be "is not"]. But maybe adding support for _Bools is easy enough to just do it
for completeness.