Skip to content

Commit 0870e27

Browse files
[libc] fix -Wgcc-compat
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
1 parent d7d0e74 commit 0870e27

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

libc/test/include/stdbit_stub.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
#include <stdbool.h> // bool in C
1818

1919
#define STDBIT_STUB_FUNCTION(FUNC_NAME, LEADING_VAL) \
20-
unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT { \
20+
unsigned FUNC_NAME##_uc(unsigned char x) { \
2121
return LEADING_VAL##AU; \
2222
} \
23-
unsigned FUNC_NAME##_us(unsigned short x) __NOEXCEPT { \
23+
unsigned FUNC_NAME##_us(unsigned short x) { \
2424
return LEADING_VAL##BU; \
2525
} \
26-
unsigned FUNC_NAME##_ui(unsigned int x) __NOEXCEPT { \
26+
unsigned FUNC_NAME##_ui(unsigned int x) { \
2727
return LEADING_VAL##CU; \
2828
} \
29-
unsigned FUNC_NAME##_ul(unsigned long x) __NOEXCEPT { \
29+
unsigned FUNC_NAME##_ul(unsigned long x) { \
3030
return LEADING_VAL##DU; \
3131
} \
32-
unsigned FUNC_NAME##_ull(unsigned long long x) __NOEXCEPT { \
32+
unsigned FUNC_NAME##_ull(unsigned long long x) { \
3333
return LEADING_VAL##EU; \
3434
}
3535

@@ -46,27 +46,27 @@ STDBIT_STUB_FUNCTION(stdc_first_trailing_one, 0x1)
4646
STDBIT_STUB_FUNCTION(stdc_count_zeros, 0x2)
4747
STDBIT_STUB_FUNCTION(stdc_count_ones, 0x3)
4848

49-
bool stdc_has_single_bit_uc(unsigned char x) __NOEXCEPT { return false; }
50-
bool stdc_has_single_bit_us(unsigned short x) __NOEXCEPT { return false; }
51-
bool stdc_has_single_bit_ui(unsigned x) __NOEXCEPT { return false; }
52-
bool stdc_has_single_bit_ul(unsigned long x) __NOEXCEPT { return false; }
53-
bool stdc_has_single_bit_ull(unsigned long long x) __NOEXCEPT { return false; }
49+
bool stdc_has_single_bit_uc(unsigned char x) { return false; }
50+
bool stdc_has_single_bit_us(unsigned short x) { return false; }
51+
bool stdc_has_single_bit_ui(unsigned x) { return false; }
52+
bool stdc_has_single_bit_ul(unsigned long x) { return false; }
53+
bool stdc_has_single_bit_ull(unsigned long long x) { return false; }
5454

5555
STDBIT_STUB_FUNCTION(stdc_bit_width, 0x4)
5656

57-
unsigned char stdc_bit_floor_uc(unsigned char x) __NOEXCEPT { return 0x5AU; }
58-
unsigned short stdc_bit_floor_us(unsigned short x) __NOEXCEPT { return 0x5BU; }
59-
unsigned stdc_bit_floor_ui(unsigned x) __NOEXCEPT { return 0x5CU; }
60-
unsigned long stdc_bit_floor_ul(unsigned long x) __NOEXCEPT { return 0x5DUL; }
61-
unsigned long long stdc_bit_floor_ull(unsigned long long x) __NOEXCEPT {
57+
unsigned char stdc_bit_floor_uc(unsigned char x) { return 0x5AU; }
58+
unsigned short stdc_bit_floor_us(unsigned short x) { return 0x5BU; }
59+
unsigned stdc_bit_floor_ui(unsigned x) { return 0x5CU; }
60+
unsigned long stdc_bit_floor_ul(unsigned long x) { return 0x5DUL; }
61+
unsigned long long stdc_bit_floor_ull(unsigned long long x) {
6262
return 0x5EULL;
6363
}
6464

65-
unsigned char stdc_bit_ceil_uc(unsigned char x) __NOEXCEPT { return 0x6AU; }
66-
unsigned short stdc_bit_ceil_us(unsigned short x) __NOEXCEPT { return 0x6BU; }
67-
unsigned stdc_bit_ceil_ui(unsigned x) __NOEXCEPT { return 0x6CU; }
68-
unsigned long stdc_bit_ceil_ul(unsigned long x) __NOEXCEPT { return 0x6DUL; }
69-
unsigned long long stdc_bit_ceil_ull(unsigned long long x) __NOEXCEPT {
65+
unsigned char stdc_bit_ceil_uc(unsigned char x) { return 0x6AU; }
66+
unsigned short stdc_bit_ceil_us(unsigned short x) { return 0x6BU; }
67+
unsigned stdc_bit_ceil_ui(unsigned x) { return 0x6CU; }
68+
unsigned long stdc_bit_ceil_ul(unsigned long x) { return 0x6DUL; }
69+
unsigned long long stdc_bit_ceil_ull(unsigned long long x) {
7070
return 0x6EULL;
7171
}
7272

0 commit comments

Comments
 (0)