Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

frobtech
Copy link
Contributor

@frobtech frobtech commented Nov 2, 2024

Consistent with glibc headers, where noexcept is used in C++
(or throw() in older C++ which llvm-libc doesn't support) in
the public function declarations, __attribute__((__nothrow__)) is
used in C for compilers that support it.

Consistent with glibc headers, where `noexcept` is used in C++
(or `throw()` in older C++ which llvm-libc doesn't support) in
the public function declarations, __attribute__((__nothrow__)) is
used in C for compilers that support it.
@frobtech frobtech marked this pull request as ready for review November 2, 2024 09:34
@llvmbot llvmbot added the libc label Nov 2, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 2, 2024

@llvm/pr-subscribers-libc

Author: Roland McGrath (frobtech)

Changes

Consistent with glibc headers, where noexcept is used in C++
(or throw() in older C++ which llvm-libc doesn't support) in
the public function declarations, attribute((nothrow)) is
used in C for compilers that support it.


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

1 Files Affected:

  • (modified) libc/include/__llvm-libc-common.h (+7)
diff --git a/libc/include/__llvm-libc-common.h b/libc/include/__llvm-libc-common.h
index 3af0b08e9e8668..22dc78e6966e14 100644
--- a/libc/include/__llvm-libc-common.h
+++ b/libc/include/__llvm-libc-common.h
@@ -47,7 +47,14 @@
 #define __restrict restrict // C99 and above support the restrict keyword.
 
 #undef __NOEXCEPT
+#if defined(__has_attribute)
+#if __has_attribute(__nothrow__)
+#define __NOEXCEPT __attribute__((__nothrow__))
+#endif // __has_attribute(__nothrow__)
+#endif // defined(__has_attribute)
+#ifndef __NOEXCEPT
 #define __NOEXCEPT
+#endif
 
 #endif // __cplusplus
 

Comment on lines 50 to 51
#if defined(__has_attribute)
#if __has_attribute(__nothrow__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really don't need to be wrapping the use of this attribute in __has_attribute checks (and checks for __has_attribute). __has_attribute has been available since GCC 5 and prehistoric versions of clang. Example: https://godbolt.org/z/vxo4Tq9KK

If our minimum supported compiler versions support these features, then wrapping them in checks upon checks is unnecessary noise in the sources. Please remove them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, in regards to #114861 which may be a response to this thread:

I agree that:

  1. the compiler and compiler version used to build the libc object files can be distinct from the compiler and compiler version used to consume the headers
  2. we should document what combinations of compiler and compiler version we support for BOTH use cases
  3. we should continuously test those documented versions

Perhaps where we differ in views is that:
4. we should not add code to llvm-libc to support compilers or compiler versions not in the above.

This is perhaps a very different viewpoint from other libc's. Bionic for instance only carries code to support clang (dunno about versions) for example.

A good litmus test for any added compatibility code is "does this support a compiler or compiler version not in the above list?" If so, then it's perhaps not worth the preprocessor soup to clutter up the code with.

If you can't point to a recent version of clang or GCC that lacks __has_attribute, then this code proposed in this PR fails this litmus test.

Regardless, you are correct that my thoughts above should be codified in public docs, not PR threads.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly disagree with your views on rules for public headers. I don't think there is community consensus for the policy you advocate here. Indeed, there is no clear community consensus at all on this subject yet. We should continue to address that as a community and reach consensus on a clear and documented policy. The current state of the header files in the source tree does not reflect any such policy, because there is none.

In the interests of moving forward incrementally I have made the conditionalization for __NOEXCEPT here consistent with existing conditionalization elsewhere in this file and other public header files. This existing de facto standard in the codebase is not entirely consistent with either the policy that you advocate or the one that I do. Until the aforementioned consensus on policy and documentation thereof is achieved, I think consistency with the existing usage elsewhere in the public headers should be the criterion for what we land now. The new version of this PR meets that criterion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts on using [[gnu::nothrow]] a la #define _Noreturn [[noreturn]] earlier in that file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, it seems clang didn't support C23/C++20 style function attributes in C until clang-17. That's still too soon for most users, so let's stick with the GNU C style function attribute then. https://godbolt.org/z/a39G76ffE

@frobtech frobtech merged commit 0b91d77 into llvm:main Dec 17, 2024
7 checks passed
@frobtech frobtech deleted the p/libc-noexcept branch December 17, 2024 20:18
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 17, 2024

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

Here is the relevant piece of the build log for the reference
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'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 17, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-fullbuild-dbg-asan running on libc-x86_64-debian-fullbuild while building libc at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 2 tests from 1 test suite.
[ RUN      ] LlvmLibcdupTest.ReadAndWriteViaDup
[       OK ] LlvmLibcdupTest.ReadAndWriteViaDup (289 us)
[ RUN      ] LlvmLibcdupTest.DupBadFD
[       OK ] LlvmLibcdupTest.DupBadFD (4 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[1417/1550] Building CXX object libc/test/src/unistd/CMakeFiles/libc.test.src.unistd.symlinkat_test.__build__.dir/symlinkat_test.cpp.o
[1418/1550] Linking CXX executable libc/test/src/unistd/libc.test.src.unistd.pread_pwrite_test.__build__
[1419/1550] Building C object libc/test/include/CMakeFiles/libc.test.include.signbit_c_test.__unit__.__build__.dir/signbit_test.c.o
[1420/1550] 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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/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 -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -fsanitize=address -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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 2 tests from 1 test suite.
[ RUN      ] LlvmLibcdupTest.ReadAndWriteViaDup
[       OK ] LlvmLibcdupTest.ReadAndWriteViaDup (289 us)
[ RUN      ] LlvmLibcdupTest.DupBadFD
[       OK ] LlvmLibcdupTest.DupBadFD (4 us)
Ran 2 tests.  PASS: 2  FAIL: 0
[1417/1550] Building CXX object libc/test/src/unistd/CMakeFiles/libc.test.src.unistd.symlinkat_test.__build__.dir/symlinkat_test.cpp.o
[1418/1550] Linking CXX executable libc/test/src/unistd/libc.test.src.unistd.pread_pwrite_test.__build__
[1419/1550] Building C object libc/test/include/CMakeFiles/libc.test.include.signbit_c_test.__unit__.__build__.dir/signbit_test.c.o
[1420/1550] 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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/build/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 -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -fsanitize=address -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/include/__llvm-libc-common.h:57:35: note: expanded from macro '__NOEXCEPT'
#define __NOEXCEPT __attribute__((__nothrow__))
                                  ^
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg-asan/llvm-project/libc/test/include/stdbit_stub.h:32:50: note: expanded from macro 'STDBIT_STUB_FUNCTION'

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 17, 2024

LLVM Buildbot has detected a new failure on builder libc-x86_64-debian-gcc-fullbuild-dbg running on libc-x86_64-debian-fullbuild while building libc at step 4 "annotate".

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[3504/3693] Building CXX object libc/test/src/arpa/inet/CMakeFiles/libc.test.src.arpa.inet.ntohl.__build__.dir/ntohl_test.cpp.o
[3505/3693] Building CXX object libc/test/src/locale/CMakeFiles/libc.test.src.locale.localeconv_test.__unit__.__build__.dir/localeconv_test.cpp.o
[3506/3693] Building CXX object libc/test/src/locale/CMakeFiles/libc.test.src.locale.locale_test.__unit__.__build__.dir/locale_test.cpp.o
[3507/3693] Running unit test libc.test.src.unistd._exit_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcUniStd._exit
[       OK ] LlvmLibcUniStd._exit (937 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[3508/3693] Building CXX object libc/test/src/dirent/CMakeFiles/libc.test.src.dirent.dirent_test.__build__.dir/dirent_test.cpp.o
[3509/3693] 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/local/bin/gcc -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/include -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -g -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:20:3: error: attributes should be specified before the declarator in a function definition
   20 |   unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT {                        \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:23:3: error: attributes should be specified before the declarator in a function definition
   23 |   unsigned FUNC_NAME##_us(unsigned short x) __NOEXCEPT {                       \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:26:3: error: attributes should be specified before the declarator in a function definition
   26 |   unsigned FUNC_NAME##_ui(unsigned int x) __NOEXCEPT {                         \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:29:3: error: attributes should be specified before the declarator in a function definition
   29 |   unsigned FUNC_NAME##_ul(unsigned long x) __NOEXCEPT {                        \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:32:3: error: attributes should be specified before the declarator in a function definition
   32 |   unsigned FUNC_NAME##_ull(unsigned long long x) __NOEXCEPT {                  \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:20:3: error: attributes should be specified before the declarator in a function definition
   20 |   unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT {                        \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:39:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   39 | STDBIT_STUB_FUNCTION(stdc_leading_ones, 0xB)
      | ^~~~~~~~~~~~~~~~~~~~
Step 8 (libc-unit-tests) failure: libc-unit-tests (failure)
...
[3504/3693] Building CXX object libc/test/src/arpa/inet/CMakeFiles/libc.test.src.arpa.inet.ntohl.__build__.dir/ntohl_test.cpp.o
[3505/3693] Building CXX object libc/test/src/locale/CMakeFiles/libc.test.src.locale.localeconv_test.__unit__.__build__.dir/localeconv_test.cpp.o
[3506/3693] Building CXX object libc/test/src/locale/CMakeFiles/libc.test.src.locale.locale_test.__unit__.__build__.dir/locale_test.cpp.o
[3507/3693] Running unit test libc.test.src.unistd._exit_test.__unit__
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcUniStd._exit
[       OK ] LlvmLibcUniStd._exit (937 us)
Ran 1 tests.  PASS: 1  FAIL: 0
[3508/3693] Building CXX object libc/test/src/dirent/CMakeFiles/libc.test.src.dirent.dirent_test.__build__.dir/dirent_test.cpp.o
[3509/3693] 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/local/bin/gcc -DLIBC_NAMESPACE=__llvm_libc_20_0_0_git -D_DEBUG -I/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/build/libc/include -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -g -fpie -DLIBC_FULL_BUILD -ffreestanding -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:20:3: error: attributes should be specified before the declarator in a function definition
   20 |   unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT {                        \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:23:3: error: attributes should be specified before the declarator in a function definition
   23 |   unsigned FUNC_NAME##_us(unsigned short x) __NOEXCEPT {                       \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:26:3: error: attributes should be specified before the declarator in a function definition
   26 |   unsigned FUNC_NAME##_ui(unsigned int x) __NOEXCEPT {                         \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:29:3: error: attributes should be specified before the declarator in a function definition
   29 |   unsigned FUNC_NAME##_ul(unsigned long x) __NOEXCEPT {                        \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:32:3: error: attributes should be specified before the declarator in a function definition
   32 |   unsigned FUNC_NAME##_ull(unsigned long long x) __NOEXCEPT {                  \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:38:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   38 | STDBIT_STUB_FUNCTION(stdc_leading_zeros, 0xA)
      | ^~~~~~~~~~~~~~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:20:3: error: attributes should be specified before the declarator in a function definition
   20 |   unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT {                        \
      |   ^~~~~~~~
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:39:1: note: in expansion of macro ‘STDBIT_STUB_FUNCTION’
   39 | STDBIT_STUB_FUNCTION(stdc_leading_ones, 0xB)
      | ^~~~~~~~~~~~~~~~~~~~

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 17, 2024

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

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

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/libc-linux.py ...' (failure)
...
[==========] Running 3 tests from 1 test suite.
[ RUN      ] LlvmLibcUniStd.WriteAndReadBackTest
[       OK ] LlvmLibcUniStd.WriteAndReadBackTest (345 us)
[ RUN      ] LlvmLibcUniStd.WriteFails
[       OK ] LlvmLibcUniStd.WriteFails (5 us)
[ RUN      ] LlvmLibcUniStd.ReadFails
[       OK ] LlvmLibcUniStd.ReadFails (4 us)
Ran 3 tests.  PASS: 3  FAIL: 0
[1428/1559] Linking CXX executable libc/test/src/unistd/libc.test.src.unistd.rmdir_test.__build__
[1429/1559] 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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/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 -Wmisleading-indentation -Wctad-maybe-unsupported -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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 3 tests from 1 test suite.
[ RUN      ] LlvmLibcUniStd.WriteAndReadBackTest
[       OK ] LlvmLibcUniStd.WriteAndReadBackTest (345 us)
[ RUN      ] LlvmLibcUniStd.WriteFails
[       OK ] LlvmLibcUniStd.WriteFails (5 us)
[ RUN      ] LlvmLibcUniStd.ReadFails
[       OK ] LlvmLibcUniStd.ReadFails (4 us)
Ran 3 tests.  PASS: 3  FAIL: 0
[1428/1559] Linking CXX executable libc/test/src/unistd/libc.test.src.unistd.rmdir_test.__build__
[1429/1559] 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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc -isystem /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/build/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 -Wmisleading-indentation -Wctad-maybe-unsupported -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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c
In file included from /home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_test.c:23:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-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/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-fullbuild-dbg/llvm-project/libc/test/include/stdbit_stub.h:32:50: note: expanded from macro 'STDBIT_STUB_FUNCTION'

@nickdesaulniers
Copy link
Member

Ahh...the noexcept fn attr has to come first: https://godbolt.org/z/Mfr66MWor. I'll get this fixed up.

@nickdesaulniers
Copy link
Member

nickdesaulniers commented Dec 17, 2024

ahh...noexcept C++ keyword cannot appear there.
https://godbolt.org/z/454EEbEsx

I think we may need to separate this out between C and C++.

i.e. now we have:

#ifdef __cplusplus
#define __NOEXCEPT noexcept
#else
#define __NOEXCEPT __attribute__((__nothrow__))
#endif

but those two can't appear in the same spot in a function decl for C and C++ modes.

@nickdesaulniers
Copy link
Member

oh, nevermind, this is different for decl vs def: https://godbolt.org/z/v1PYoMqcv. So just the failing test needs to be fixed up.

nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this pull request Dec 17, 2024
I don't quite recall why I added those in the first place. These tests build
without diagnostics for both clang and GCC with this fix.

Fixes: llvm#114653
nickdesaulniers added a commit that referenced this pull request Dec 17, 2024
I don't quite recall why I added those in the first place. These tests build
without diagnostics for both clang and GCC with this fix.

Fixes: #114653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants