]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add stdckdint.h header for C23
authorJakub Jelinek <jakub@redhat.com>
Sat, 12 Aug 2023 07:42:58 +0000 (09:42 +0200)
committerJakub Jelinek <jakub@redhat.com>
Sat, 12 Aug 2023 07:42:58 +0000 (09:42 +0200)
commit8441841a1b985d68245954af1ff023db121b0635
tree82fa873f8a85aaa865b91ecf5c8fba8ae8611ceb
parent9890f377013cf1e4f5b9fab8a7287a5380dade1f
Add stdckdint.h header for C23

This patch adds <stdckdint.h> header, which defines ckd_{add,sub,mul}
using __builtin_{add,sub,mul}_overflow.  As requested, it doesn't
pedantically diagnose things which work just fine, e.g. inputs with
plain char, bool, bit-precise integer or enumerated types and
result pointer to plain char or bit-precise integer.
The header will #include_next <stdckdint.h> so that C library can supply
its part if the header implementation in the future needs to be split
between parts under the control of the compiler and parts under the
control of C library.

2023-08-12  Jakub Jelinek  <jakub@redhat.com>

* Makefile.in (USER_H): Add stdckdint.h.
* ginclude/stdckdint.h: New file.

* gcc.dg/stdckdint-1.c: New test.
* gcc.dg/stdckdint-2.c: New test.
gcc/Makefile.in
gcc/ginclude/stdckdint.h [new file with mode: 0644]
gcc/testsuite/gcc.dg/stdckdint-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/stdckdint-2.c [new file with mode: 0644]