Bruno Haible <[email protected]> writes:
> I needed more infos about this bug fix (so I can know why the CI did
> not report it within three weeks). Since bug-gnulib was not in CC, I had
> to search. I updated this ChangeLog entry:
timespec-sub.c:38:12: error: operand argument to checked integer operation must
be an integer type
other than plain 'char', 'bool', bit-precise, or an enumeration ('bool'
invalid)
38 | if (v == ckd_sub (&rs, rs, borrow))
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/llvm/18.1.8/lib/clang/18/include/stdckdint.h:38:54: note:
expanded from macro
'ckd_sub'
38 | #define ckd_sub(R, A, B) __builtin_sub_overflow((A), (B), (R))
| ^
Good to know thanks.
I was going to say that I wish it just treated bools as 0/1 but per the
documentation for ckd_* in C23 ยง 7.20 [1]:
Both type2 and type3 shall be any integer type other than "plain"
char, bool, a bit-precise integer type, or an enumerated type, and
they need not be the same. *result shall be a modifiable lvalue of
any integer type other than "plain" char, bool, a bit-precise
integer type, or an enumerated type.
So I guess I can't complain.
Collin
[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf