]> git.ipfire.org Git - thirdparty/xz.git/commit
tuklib: Update tuklib_attr_noreturn for C11/C17 and C23.
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 8 Sep 2023 15:19:26 +0000 (18:19 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 22 Sep 2023 17:06:21 +0000 (20:06 +0300)
commit90c94dddfd57b7d744bfad64c54e10d15778144b
tree4319b205d0cdeed9abbc38b3b9555c56845ac158
parent189f72581329ab281ad6af37f60135910cb1b146
tuklib: Update tuklib_attr_noreturn for C11/C17 and C23.

This makes no difference for GCC or Clang as they support
GNU C's __attribute__((__noreturn__)) but this helps with MSVC:

  - VS 2019 version 16.7 and later support _Noreturn if the
    options /std:c11 or /std:c17 are used. This gets handled
    with the check for __STDC_VERSION__ >= 201112.

  - When MSVC isn't in C11/C17 mode, __declspec(noreturn) is used.

C23 will deprecate _Noreturn (and <stdnoreturn.h>)
for [[noreturn]]. This commit anticipates that but
the final __STDC_VERSION__ value isn't known yet.
src/common/tuklib_common.h
src/common/tuklib_exit.h