[libc-commits] [libc] [libc] Use __attribute__((__nothrow__)) for __NOEXCEPT in C (PR #114653)

LLVM Continuous Integration via libc-commits libc-commits at lists.llvm.org
Tue Dec 17 12:20:25 PST 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `libc-aarch64-ubuntu-fullbuild-dbg` running on `libc-aarch64-ubuntu` while building `libc` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/71/builds/12797

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSignalTest.SigaddsetInvalid
[       OK ] LlvmLibcSignalTest.SigaddsetInvalid (2 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[1231/1309] Running unit test libc.test.include.fpclassify_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFpClassifyTest.SpecialNumbers
[       OK ] LlvmLibcFpClassifyTest.SpecialNumbers (3 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[1232/1309] Building C object libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o
FAILED: libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o 
/usr/bin/clang -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem libc/include -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-comment -Wstring-conversion -fdiagnostics-color -g -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wall -Werror -MD -MT libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o -MF libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o.d -o libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:20:44: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT {                        \
                                           ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:23:45: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_us(unsigned short x) __NOEXCEPT {                       \
                                            ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:26:43: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_ui(unsigned int x) __NOEXCEPT {                         \
                                          ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:29:44: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_ul(unsigned long x) __NOEXCEPT {                        \
                                           ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:32:50: note: expanded from macro 'STDBIT_STUB_FUNCTION'
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSignalTest.SigaddsetInvalid
[       OK ] LlvmLibcSignalTest.SigaddsetInvalid (2 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[1231/1309] Running unit test libc.test.include.fpclassify_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcFpClassifyTest.SpecialNumbers
[       OK ] LlvmLibcFpClassifyTest.SpecialNumbers (3 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[1232/1309] Building C object libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o
FAILED: libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o 
/usr/bin/clang -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc -isystem libc/include -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-comment -Wstring-conversion -fdiagnostics-color -g -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wall -Werror -MD -MT libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o -MF libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o.d -o libc/test/include/CMakeFiles/libc.test.include.stdbit_c_test.__unit__.__build__.dir/stdbit_test.c.o -c /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:20:44: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT {                        \
                                           ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:23:45: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_us(unsigned short x) __NOEXCEPT {                       \
                                            ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:26:43: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_ui(unsigned int x) __NOEXCEPT {                         \
                                          ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:29:44: note: expanded from macro 'STDBIT_STUB_FUNCTION'
  unsigned FUNC_NAME##_ul(unsigned long x) __NOEXCEPT {                        \
                                           ^
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: error: GCC does not allow '__nothrow__' attribute in this position on a function definition [-Werror,-Wgcc-compat]
/home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:32:50: note: expanded from macro 'STDBIT_STUB_FUNCTION'

```

</details>

https://github.com/llvm/llvm-project/pull/114653


More information about the libc-commits mailing list