Skip to content

Commit 8855fdc

Browse files
Dendi Suhubdyclaude
andcommitted
Use pragma to suppress -Wpedantic for __int128 typedef
__extension__ doesn't work in using declarations with GCC. Use #pragma GCC diagnostic push/pop instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dfc4d15 commit 8855fdc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/crypto/field25519.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
namespace tor::crypto {
55

66
using u64 = uint64_t;
7-
using u128 = __extension__ unsigned __int128;
7+
#pragma GCC diagnostic push
8+
#pragma GCC diagnostic ignored "-Wpedantic"
9+
using u128 = unsigned __int128;
10+
#pragma GCC diagnostic pop
811

912
static constexpr u64 MASK51 = FieldElement::MASK51;
1013

src/crypto/secretbox.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ void poly1305(
231231
std::span<const uint8_t> message,
232232
std::span<const uint8_t, 32> key) {
233233

234-
using u128 = __extension__ unsigned __int128;
234+
#pragma GCC diagnostic push
235+
#pragma GCC diagnostic ignored "-Wpedantic"
236+
using u128 = unsigned __int128;
237+
#pragma GCC diagnostic pop
235238

236239
// Clamp r (first 16 bytes of key)
237240
uint32_t r0 = load32_le(key.data()) & 0x0fffffff;

0 commit comments

Comments
 (0)