]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Use standard C23 and C++ attributes if available
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 1 Apr 2026 06:03:01 +0000 (08:03 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 1 Apr 2026 06:15:02 +0000 (08:15 +0200)
commit76f4b92bac87fa54bd6dd8bd53e59f93127ec2ef
tree06414e56336e0cf52e3f1cf5f3466926f52c75af
parentc05ad248f99c729b53f6fa83939266b509682c33
Use standard C23 and C++ attributes if available

Use the standard C23 and C++ attributes [[nodiscard]], [[noreturn]],
and [[maybe_unused]], if available.

This makes pg_nodiscard and pg_attribute_unused() available in
not-GCC-compatible compilers that support C23 as well as in C++.

For pg_noreturn, we can now drop the GCC-specific and MSVC-specific
fallbacks, because the C11 and the C++ implementation will now cover
all required cases.

Note, in a few places, we need to change the position of the attribute
because it's not valid in that place in C23.

Discussion: https://www.postgresql.org/message-id/flat/pxr5b3z7jmkpenssra5zroxi7qzzp6eswuggokw64axmdixpnk@zbwxuq7gbbcw
src/backend/utils/mmgr/slab.c
src/include/c.h
src/include/lib/radixtree.h
src/test/modules/worker_spi/worker_spi.c